diff --git a/website/i18n/fr/code.json b/website/i18n/fr/code.json index e7d0813e..81980a5c 100644 --- a/website/i18n/fr/code.json +++ b/website/i18n/fr/code.json @@ -421,11 +421,11 @@ "description": "The ARIA label for hamburger menu button of mobile navigation" }, "theme.NavBar.navAriaLabel": { - "message": "Main", + "message": "Menu Principal", "description": "The ARIA label for the main navigation" }, "theme.docs.sidebar.navAriaLabel": { - "message": "Docs sidebar", + "message": "Barre latérale de la documentation", "description": "The ARIA label for the sidebar navigation" } } diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx index 0cd8312e..fa0e07f5 100644 --- a/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx @@ -20,59 +20,59 @@ tags: # Introduction -Wails est un projet qui simplifie la possibilité d'écrire des applications de bureau inter-plateformes en utilisant Go. It uses native webview components for the frontend (not embedded browsers), bringing the power of the world's most popular UI system to Go, whilst remaining lightweight. +Wails est un projet qui simplifie la possibilité d'écrire des applications de bureau inter-plateformes en utilisant Go. Il utilise des composants web natifs pour le frontend (pas de navigateurs intégrés) apportant à Go la puissance du système d'interface utilisateur le plus populaire au monde, tout en restant léger. La version 2 a été publiée le 22 septembre 2022 et a apporté de nombreuses améliorations y compris : -- Live development, leveraging the popular Vite project -- Rich functionality for managing windows and creating menus -- Microsoft's WebView2 component -- Generation of Typescript models that mirror your Go structs -- Creating of NSIS Installer -- Obfuscated builds +- Développement en direct, en tirant parti du projet populaire Vite +- Fonctionnalités avancées pour gérer les fenêtres et créer des menus +- Composants Microsoft WebView2 +- Génération de modèles Typescript qui reflètent vos structures Go +- Création de l'installateur NSIS +- Compilations obfusquées -Right now, Wails v2 provides powerful tooling for creating rich, cross-platform desktop applications. +En ce moment, Wails v2 fournit un outil puissant pour créer des applications de bureau riches et multiplateforme. -This blog post aims to look at where the project is at right now and what we can improve on moving forward. +Ce billet de blog vise à voir où se trouve le projet en ce moment et ce que nous pouvons améliorer pour aller de l'avant. # Où en sommes-nous actuellement? -It's been incredible to see the popularity of Wails rising since the v2 release. I'm constantly amazed by the creativity of the community and the wonderful things that are being built with it. With more popularity, comes more eyes on the project. And with that, more feature requests and bug reports. +C'est incroyable de voir la popularité de Wails en hausse depuis la version v2. Je suis constamment stupéfait par la créativité de la communauté et les choses merveilleuses qui sont en train d'être construites avec elle. Avec plus de popularité, vient plus d'yeux sur le projet. Et avec cela, plus de demandes de fonctionnalités et rapports de bogues. -Over time, I've been able to identify some of the most pressing issues facing the project. I've also been able to identify some of the things that are holding the project back. +Au fil du temps, j'ai pu identifier certains des problèmes les plus urgents auxquels le projet est confronté. J'ai également été en mesure d'identifier certaines des choses qui tirent le projet vers l'arrière. ## Problèmes actuels -I've identified the following areas that I feel are holding the project back: +J'ai identifié les domaines suivants qui, selon moi, tirent le projet vers l'arrière : -- The API -- Bindings generation -- The Build System +- L'API +- Génération des liaisons +- Le système de compilation -### The API +### L'API -The API to build a Wails application currently consists of 2 parts: +L'API pour construire une application Wails se compose actuellement de 2 parties : -- The Application API -- The Runtime API +- La partie applicative +- La partie exécution -The Application API famously has only 1 function: `Run()` which takes a heap of options which govern how the application will work. Whilst this is very simple to use, it is also very limiting. It is a "declarative" approach which hides a lot of the underlying complexity. For instance, there is no handle to the main window, so you can't interact with it directly. For that, you need to use the Runtime API. This is a problem when you start to want to do more complex things like create multiple windows. +La partie applicative ne possède qu'une fonction : `Run()` qui prend un tas d'options qui régissent le fonctionnement de l'application. Bien que cela soit très simple à utiliser, elle est également très limitée. C'est une approche "déclarative" qui masque beaucoup de la complexité sous-jacente. Par exemple, il n'y a pas de gestion de la fenêtre principale, faisant qu'il n'est pas possible d'intéragir directement avec. Pour cela, vous devez utiliser la partie exécution de l'API. Ceci est un problème lorsque vous commencez à vouloir faire des choses plus complexes comme créer plusieurs fenêtres. -The Runtime API provides a lot of utility functions for the developer. This includes: +La partie exécution fournit de nombreuses fonctions utilitaires pour le développeur. Incluant : -- Window management -- Dialogs -- Menus -- Events -- Logs +- La gestion des fenêtres +- Les boites de dialogues +- Les menus +- Les évènements +- Les journaux de logs -There are a number of things I am not happy with the Runtime API. The first is that it requires a "context" to be passed around. This is both frustrating and confusing for new developers who pass in a context and then get a runtime error. +Il y a un certain nombre de choses dont je ne suis pas satisfait dans la partie exécution de l'API. La première est que nécessite un "contexte" pour être contourné. C'est autant frustrant que confusant pour les nouveaux développeurs qui donnent un contexte et qui obtiennent une erreur runtime. -The biggest issue with the Runtime API is that it was designed for applications that only use a single window. Over time, the demand for multiple windows has grown and the API is not well suited to this. +Le plus gros problème avec la partie exécution de l'API est que cela a été pensé pour des applications qui n'ont qu'une seule fenêtre. Au fil du temps, la demande pour plusieurs fenêtres a augmenté et l'API n'est pas adaptée à cela. -### Thoughts on the v3 API +### Réflexions sur l'API v3 -Wouldn't it be great if we could do something like this? +Ne serait-ce pas génial si nous pouvions faire quelque chose comme ça ? ```go func main() { @@ -86,7 +86,7 @@ func main() { } ``` -This programmatic approach is far more intuitive and allows the developer to interact with the application elements directly. All current runtime methods for windows would simply be methods on the window object. For the other runtime methods, we could move them to the application object like so: +Cette approche programmatique est beaucoup plus intuitive et permet au développeur d'interagir avec les éléments d'application directement. Toutes les méthodes d'exécution pour les fenêtres seraient simplement des méthodes dans l'objet fenêtre. Pour toutes les autres méthodes qui étaient présentes dans la partie exécution de l'API, on pourrait les déplacer dans un objet application comme suit : ```go app := wails.NewApplication(options.App{}) @@ -94,7 +94,7 @@ app.NewInfoDialog(options.InfoDialog{}) app.Log.Info("Hello World") ``` -This is a much more powerful API which will allow for more complex applications to be built. It also allows for the creation of multiple windows, [the most up-voted feature on GitHub](https://github.com/wailsapp/wails/issues/1480): +Cela devient une API bien plus puissante, capable de construire des applications plus complexes. Il permet également la création de plusieurs fenêtres, [la fonctionnalité la plus votée sur GitHub](https://github.com/wailsapp/wails/issues/1480): ```go func main() { @@ -113,72 +113,72 @@ func main() { } ``` -### Bindings generation +### Génération des liaisons -One of the key features of Wails is generating bindings for your Go methods so they may be called from Javascript. The current method for doing this is a bit of a hack. It involves building the application with a special flag and then running the resultant binary which uses reflection to determine what has been bound. This leads to a bit of a chicken and egg situation: You can't build the application without the bindings and you can't generate the bindings without building the application. There are many ways around this but the best one would be not to use this approach at all. +L'une des fonctionnalités clés de Wails est la génération de liaisons pour permettre à vos méthodes Go d'être appelées à partir du Javascript. La méthode courante pour faire cela est un peu un hack. Il implique de construire l'application avec une option spéciale, puis d'exécuter le binaire qui utilise la réflexion pour déterminer ce qui lui a été lié. Cela mène à une situation de la poule et de l'oeuf : vous ne pouvez pas construire l'application sans les liaisons et vous ne pouvez pas générer les liaisons sans construire l'application. Il y a plusieurs façons de contourner cela, mais le meilleur serait de ne pas utiliser cette approche du tout. -There was a number of attempts at writing a static analyser for Wails projects but they didn't get very far. In more recent times, it has become slightly easier to do this with more material available on the subject. +Il y a eu un certain nombre de tentatives d'écriture d'un analyseur statique pour les projets Wails mais ils ne sont pas allés très loin. Plus récemment, il est devenu légèrement plus facile de le faire avec le nouveau matériel disponible sur le sujet. -Compared to reflection, the AST approach is much faster however it is significantly more complicated. To start with, we may need to impose certain constraints on how to specify bindings in the code. The goal is to support the most common use cases and then expand it later on. +Comparée à la réflexion, l'approche AST est beaucoup plus rapide, cependant elle est considérablement plus compliquée. Pour commencer, nous pourrions devoir imposer certaines contraintes sur la façon de spécifier les liaisons dans le code. L'objectif est de supporter les cas d'utilisation les plus courants, puis d'étendre plus tard. -### The Build System +### Le système de compilation -Like the declarative approach to the API, the build system was created to hide the complexities of building a desktop application. When you run `wails build`, it does a lot of things behind the scenes: -- Builds the backend binary for bindings and generates the bindings -- Installs the frontend dependencies -- Builds the frontend assets -- Determines if the application icon is present and if so, embeds it -- Builds the final binary -- If the build is for `darwin/universal` it builds 2 binaries, one for `darwin/amd64` and one for `darwin/arm64` and then creates a fat binary using `lipo` -- If compression is required, it compresses the binary with UPX -- Determines if this binary is to be packaged and if so: - - Ensures the icon and application manifest are compiled into the binary (Windows) - - Builds out the application bundle, generates the icon bundle and copies it, the binary and Info.plist to the application bundle (Mac) -- If an NSIS installer is required, it builds it +Comme l'approche déclarative de l'API, le système de construction a été créé pour masquer les complexités de la construction d'une application de bureau. Quand vous exécutez la commande `wails build`, ça effectue pas mal de choses de manière invisible : +- Construit le binaire d'arrière-plan pour les liaisons et génère les liaisons +- Installe les dépendances frontend +- Construit les ressources du frontend +- Détermine si l'icône de l'application est présente et si oui, l'intègre +- Construit le binaire final +- Si l'application est construite pour `darwin/universal`, ça va générer deux fichiers binaires, un pour `darwin/amd64` et un pour `darwin/arm64` avant d'en créer un dernier incluant les deux premiers en utilisant `lipo` +- Si la compression est demandée, le binaire est compressé avec UPX +- Détermine si ce binaire doit être empaqueté et si c'est le cas : + - S'assure que l'icône et le manifeste d'application sont compilés dans le binaire (Windows) + - Construit le lot d'applications, génère le lot d'icônes et le copie avec le binaire et Info.plist dans le bundle d'applications (Mac) +- Si un installateur NSIS est demandé, il le construit -This entire process, whilst very powerful, is also very opaque. It is very difficult to customise it and it is very difficult to debug. +Tout ce processus, bien que très puissant, est également très opaque. Le rendant très difficile à personnalisé et débugger. -To address this in v3, I would like to move to a build system that exists outside of Wails. After using [Task](https://taskfile.dev/) for a while, I am a big fan of it. It is a great tool for configuring build systems and should be reasonably familiar to anyone who has used Makefiles. +Pour résoudre ce problème dans la v3, je voudrais passer à un système de compilation qui existe en dehors de Wails. Après avoir utilisé [Task](https://taskfile.dev/) pendant un certain temps, je suis un grand fan de ça. C'est un excellent outil pour configurer les systèmes de compilation et devrait être raisonnablement familier à tous ceux qui ont utilisé Makefiles. -The build system would be configured using a `Taskfile.yml` file which would be generated by default with any of the supported templates. This would have all of the steps required to do all the current tasks, such as building or packaging the application, allowing for easy customisation. +Le système de compilation serait configuré à l'aide d'un fichier `Taskfile.yml` qui serait généré par défaut avec n'importe lequel des modèles supportés. Cela contiendrait toutes les étapes requises pour effectuer toutes les tâches actuelles, comme la construction ou l'empaquetage de l'application, mais permettrait de facilement personnaliser ce processus. -There will be no external requirement for this tooling as it would form part of the Wails CLI. This means that you can still use `wails build` and it will do all the things it does today. However, if you want to customise the build process, you can do so by editing the `Taskfile.yml` file. It also means you can easily understand the build steps and use your own build system if you wish. +Il n'y aurait pas de prérequis pour pouvoir utiliser cet outil vu qu'il sera intégré comme étant une partie du CLI de Wails. Cela signifie que vous pouvez toujours utiliser `wails build` et qu'il fera tout ce qu'il fait déjà aujourd'hui. Cependant, si vous souhaitez personnaliser le processus de compilation, vous pourrez le faire en éditant le fichier `Taskfile.yml`. Cela signifie aussi que vous pourrez comprendre facilement les différentes étapes de compilation et créer votre propre processus de compilation si vous le désirez. -The missing piece in the build puzzle is the atomic operations in the build process, such as icon generation, compression and packaging. To require a bunch of external tooling would not be a great experience for the developer. To address this, the Wails CLI will provide all these capabilities as part of the CLI. This means that the builds still work as expected, with no extra external tooling, however you can replace any step of the build with any tool you like. +Les pièces manquantes dans le puzzle de la compilation sont les opérations atomiques comme la génération d'icônes, la compression et la création du package. Avoir une liste d'application et autres outils comme prérequis ne serait pas une bonne expérience pour le développeur. Pour résoudre ce problème, le CLI Wails fournira toutes ces fonctionnalités dans le CLI. Cela signifie que les compilations vont toujours se faire comme prévues, sans outils externes. Cependant, vous pourrez remplacer n'importe quel outil utilisé dans le processus de compilation. -This will be a much more transparent build system which will allow for easier customisation and address a lot of the issues that have been raised around it. +Ceci sera un système de compilation beaucoup plus transparent qui permettra une personnalisation plus facile et de résoudre un grand nombre des problèmes qui ont été soulevés autour de lui. -## The Payoff +## Le gain -These positive changes will be a huge benefit to the project: -- The new API will be much more intuitive and will allow for more complex applications to be built. -- Using static analysis for bindings generation will be much faster and reduce a lot of the complexity around the current process. -- Using an established, external build system will make the build process completely transparent, allowing for powerful customisation. +Ces changements positifs constitueront un énorme avantage pour le projet: +- La nouvelle API sera beaucoup plus intuitive et permettra de construire des applications plus complexes . +- Utiliser l'analyse statique pour la génération des liaisons sera beaucoup plus rapide et réduira beaucoup de la complexité vis à vis du processus actuel. +- Utiliser un système de compilation externe établi rendra le processus de compilation complètement transparent, permettant une plus grande personnalisation. -Benefits to the project maintainers are: +Les avantages pour les responsables du projet sont : -- The new API will be much easier to maintain and adapt to new features and platforms. -- The new build system will be much easier to maintain and extend. I hope this will lead to a new ecosystem of community driven build pipelines. -- Better separation of concerns within the project. This will make it easier to add new features and platforms. +- La nouvelle API sera beaucoup plus facile à maintenir et à adapter aux nouvelles fonctionnalités et plates-formes. +- Le nouveau système de compilation sera beaucoup plus facile à maintenir et à étendre. J'espère que cela conduira à un nouvel écosystème de pipelines de construction pilotés par la communauté. +- Une meilleure séparation des préoccupations au sein du projet. Cela facilitera l'ajout de nouvelles fonctionnalités et de nouvelles plateformes. ## Le Plan -A lot of the experimentation for this has already been done and it's looking good. There is no current timeline for this work but I'm hoping by the end of Q1 2023, there will be an alpha release for Mac to allow the community to test, experiment with and provide feedback. +Un grand nombre de tests ont déjà été réalisés et ça se passe très bien. Il n'y a pas de calendrier actuel pour ce travail, mais j'espère d'ici la fin du T1 2023, là sera une version alpha pour Mac pour permettre à la communauté de tester, d'expérimenter et de fournir des commentaires. ## Résumé -- The v2 API is declarative, hides a lot from the developer and not suitable for features such as multiple windows. A new API will be created which will be simpler, intuitive and more powerful. -- The build system is opaque and difficult to customise so we will move to an external build system which will open it all up. -- The bindings generation is slow and complex so we will move to static analysis which will remove a lot of the complexity the current method has. +- L'API v2 est déclarative, mais masque beaucoup de choses au développeur et ne convient pas pour des fonctionnalités telles que les fenêtres multiples. La nouvelle API sera créée sera plus simple, intuitive et plus puissante. +- Le système de compilation est opaque et difficile à personnaliser donc nous allons passer à un système de compilation externe qui l'ouvrira tous. +- La génération des liaisons est lente et complexe, donc nous allons passer à l'analyse statique qui supprimera une grande partie de la complexité de la méthode actuelle. -There has been a lot of work put into the guts of v2 and it's solid. It's now time to address the layer on top of it and make it a much better experience for the developer. +Il y a eu beaucoup de travail dans les entrailles de la v2 et c'est solide. Il est maintenant temps d'aborder la couche au-dessus de celle-ci et d'en faire une bien meilleure expérience pour le développeur. -I hope you are as excited about this as I am. I'm looking forward to hearing your thoughts and feedback. +J'espère que vous êtes aussi excité que moi à ce sujet. J'ai hâte d'entendre vos réflexions et vos commentaires. Cordialement, ‐ Lea -PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! +PPS : Si vous ou votre entreprise trouvez Wails utile, veuillez envisager [de parrainer le projet](https://github.com/sponsors/leaanthony). Merci ! -PPS: Yes, that's a genuine screenshot of a multi-window application built with Wails. It's not a mockup. It's real. It's awesome. It's coming soon. \ No newline at end of file +PPS: Oui, c'est une véritable capture d'écran d'une application multi-fenêtres construite avec Wails. Ce n'est pas une maquette. C'est réel. C'est génial ! Ca va arriver bientôt. \ No newline at end of file diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/bulletinboard.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/bulletinboard.mdx index 37be7513..2c56a2e8 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/bulletinboard.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/bulletinboard.mdx @@ -7,4 +7,4 @@

``` -The [BulletinBoard](https://github.com/raguay/BulletinBoard) application is a versital message board for static messages or dialogs to get information from the user for a script. It has a TUI for creating new dialogs that can latter be used to get information from the user. It's design is to stay running on your system and show the information as needed and then hide away. I have a process for watching a file on my system and sending the contents to BulletinBoard when changed. It works great with my workflows. There is also an [Alfred workflow](https://github.com/raguay/MyAlfred/blob/master/Alfred%205/EmailIt.alfredworkflow) for sending information to the program. The workflow is also for working with [EmailIt](https://github.com/raguay/EmailIt). +L'application [BulletinBoard](https://github.com/raguay/BulletinBoard) est un panneau de messages versitaux pour les messages statiques ou les boîtes de dialogue pour obtenir des informations de l'utilisateur pour un script. Il a une TUI pour créer de nouvelles boîtes de dialogue qui peuvent être utilisées pour obtenir des informations de l'utilisateur. Son design est de rester en fonctionnement sur votre système et de montrer les informations au besoin, puis de se cacher. J'ai un processus pour surveiller un fichier sur mon système et pour envoyer le contenu à BulletinBoard une fois modifié. Cela fonctionne très bien avec mes workflows. Il y a auss un [workflow Alfred](https://github.com/raguay/MyAlfred/blob/master/Alfred%205/EmailIt.alfredworkflow) pour envoyer les informations au programme. Le workflow fonctionne aussi avec [EmailIt](https://github.com/raguay/EmailIt). diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx index c1817b70..ac64e25a 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx @@ -7,4 +7,4 @@

``` -[EmailIt](https://github.com/raguay/EmailIt/) is a Wails 2 program that is a markdown based email sender only with nine notepads, scripts to manipulate the text, and templates. It also has a scripts terminal to run scripts in EmailIt on files in your system. The scripts and templates can be used from the commandline itself or with the Alfred, Keyboard Maestro, Dropzone, or PopClip extensions. It also supports scripts and themes downloaded form GitHub. Documentation is not complete, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application. +[EmailIt](https://github.com/raguay/EmailIt/) est un programme Wails 2 qui est un expéditeur de courrier électronique basé sur le markdown uniquement avec neuf blocs-notes, pour manipuler le texte et les modèles. Il a également un terminal pour exécuter des scripts dans EmailIt sur les fichiers de votre système. Les scripts et modèles peuvent être utilisés depuis la ligne de commande elle-même ou avec les extensions Alfred, Keyboard Maestro, Dropzone ou PopClip. Il supporte également les scripts et thèmes téléchargés sous GitHub. La documentation n'est pas complète, mais le programme fonctionne. Il est construit en utilisant Wails2 et Svelte, et le téléchargement est une application macOS universelle. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx index 87e5837d..21fd4b11 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx @@ -7,4 +7,4 @@

``` -[hiposter](https://github.com/obity/hiposter) is a simple and efficient http API testing client tool. Based on Wails, Go and sveltejs. +[hiposter](https://github.com/obity/hiposter) est un outil client de test d'API http simple et efficace. Basé sur les Wails, Go et sveltejs. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx index 6f360f64..fe644bd7 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -9,6 +9,6 @@

``` -[Modal File Manager](https://github.com/raguay/ModalFileManager) est un gestionnaire de fichiers à double volet utilisant des technologies web. Mon design original était basé sur NW.js et peut être trouvé [ici](https://github.com/raguay/ModalFileManager-NWjs). Cette version utilise le même code frontend basé sur Svelte (mais il a été grandement modifié depuis le départ de NW.js), mais le backend est une implémentation de [Wails 2](https://wails.io/). By using this implementation, I no longer use command line `rm`, `cp`, etc. commands, but a git install has to be on the system to download themes and extensions. Il est entièrement codé en utilisant Go et fonctionne beaucoup plus rapidement que les versions précédentes. +[Modal File Manager](https://github.com/raguay/ModalFileManager) est un gestionnaire de fichiers à double volet utilisant des technologies web. Mon design original était basé sur NW.js et peut être trouvé [ici](https://github.com/raguay/ModalFileManager-NWjs). Cette version utilise le même code frontend basé sur Svelte (mais il a été grandement modifié depuis le départ de NW.js), mais le backend est une implémentation de [Wails 2](https://wails.io/). En utilisant cette implémentation, je n'utilise plus la ligne de commande `rm`, `cp`, etc. , mais une installation de git doit être présente sur le système pour télécharger des thèmes et des extensions. Il est entièrement codé en utilisant Go et fonctionne beaucoup plus rapidement que les versions précédentes. -Ce gestionnaire de fichiers est conçu autour du même principe que Vim: l'état est contrôlé par des actions via le clavier. Le nombre d'états n'est pas fixe, mais très programmable. Par conséquent, un nombre infini de configurations de clavier qui peuvent être créées et utilisées. C'est la principale différence par rapport aux autres gestionnaires de fichiers. There are themes and extensions available to download from GitHub. +Ce gestionnaire de fichiers est conçu autour du même principe que Vim: l'état est contrôlé par des actions via le clavier. Le nombre d'états n'est pas fixe, mais très programmable. Par conséquent, un nombre infini de configurations de clavier qui peuvent être créées et utilisées. C'est la principale différence par rapport aux autres gestionnaires de fichiers. Il y a des thèmes et des extensions disponibles à télécharger à partir de GitHub. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx index b5828f8a..d7215d66 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -7,4 +7,4 @@

``` -[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) is a program to show the output of scripts or [Node-Red](https://nodered.org) server. It runs scripts defined in EmailIt program and shows the output. Scripts from xBar or TextBar can be used, but currently on the TextBar scripts work well. Il affiche également la sortie des scripts sur votre système. ScriptBar ne les met pas dans la barre de menus, mais les a tous dans une fenêtre convenable pour une visualisation facile. Vous pouvez avoir plusieurs onglets pour voir plusieurs choses différentes. Vous pouvez également conserver les liens vers vos sites Web les plus visités. +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) est un programme pour afficher la sortie de scripts ou d'un serveur [Node-Red](https://nodered.org). Il exécute des scripts définis dans le programme EmailIt et affiche la sortie. Des scripts de xBar ou TextBar peuvent être utilisés. Actuellement sur les scripts TextBar fonctionnent bien. Il affiche également la sortie des scripts sur votre système. ScriptBar ne les met pas dans la barre de menus, mais les a tous dans une fenêtre convenable pour une visualisation facile. Vous pouvez avoir plusieurs onglets pour voir plusieurs choses différentes. Vous pouvez également conserver les liens vers vos sites Web les plus visités. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx index 950dc3f3..2e427433 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx @@ -1,4 +1,4 @@ -# Minecraft launcher for WarMine +# Lanceur Minecraft pour WarMine ```mdx-code-block

@@ -12,8 +12,8 @@

``` -[Minecraft launcher for WarMine](https://warmine.ru/) is a Wails application, that allows you to easily join modded game servers and manage your game accounts. +[Lanceur Minecraft pour WarMine](https://warmine.ru/) est une application Wails qui vous permet facilement de rejoindre le serveur de jeu contenant les mods, ainsi que la gestion de vos comptes de jeu. -The Launcher downloads the game files, checks their integrity and launches the game with a wide range of customization options for the launch arguments from the backend. +Le Launcher télécharge les fichiers du jeu, vérifie leur intégrité et lance le jeu avec une large gamme d'options de personnalisation. -Frontend is written in Svelte, whole launcher fits in 9MB and supports Windows 7-11. +Le frontend est écrit en Svelte, le lanceur entier tient dans 9Mo et prend en charge Windows 7-11. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx index a2bf2b75..b4ab74e2 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ Si vous n'êtes pas sûr d'un modèle, inspectez `package.json` et `wails.json` - [wails-react-template](https://github.com/flin7/wails-react-template) - Un modèle minimal pour React qui supporte le développement en direct - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - Un modèle utilisant Next.js et TypeScript - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - Un modèle pour React + TypeScript + Vite + TailwindCSS +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - Un modèle avec Vite, React, TypeScript, TailwindCSS, et shadcn/ui ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - Un modèle utilisant Svelte - [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - Un modèle utilisant Svelte et Vite - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - Un modèle utilisant Svelte et Vite avec TailwindCSS v3 +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - Un modèle utilisant SvelteKit ## Solid diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/application-development.mdx index b638f6fc..764f2240 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ Le serveur de développement utilise une technique appelée "debouncing", ce qui ## Serveur de développement externe -Certains frameworks sont fournis avec leur propre serveur de rechargement en direct, cependant ils ne seront pas en mesure de tirer parti des liaisons Wails Go. Dans ce scénario, il est préférable d'exécuter un script qui va surveiller le projet dans dossier build, dossier que Wails surveille aussi. Pour un exemple, voir le modèle svelte par défaut qui utilise [rollup](https://rollupjs.org/guide/en/). Pour [create-react-app](https://create-react-app.dev/), il est possible d'utiliser [ce script](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd) pour obtenir un résultat similaire. +Certains frameworks sont fournis avec leur propre serveur de rechargement en direct, cependant ils ne seront pas en mesure de tirer parti des liaisons Wails Go. Dans ce scénario, il est préférable d'exécuter un script qui va surveiller le projet dans dossier build, dossier que Wails surveille aussi. Pour un exemple, voir le modèle svelte par défaut qui utilise [rollup](https://rollupjs.org/guide/en/). + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Module Go diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `
` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index e5539f2e..5b319f9a 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ If this does happen, simply delete `frontend/node_modules` and `frontend/package ## Build process stuck on "Generating bindings" Bindings generation process runs your application in a special mode. If application, intentionally or unintentionally, contains an endless loop (i.e. not exiting after `wails.Run()` finished), this can lead to build process stuck on the stage of bindings generation. Please make sure your code exits properly. + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx index 0a57f585..0a654473 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx @@ -236,7 +236,7 @@ Tous les types de données sont correctement traduits entre Go et JavaScript. M :::info Note -Struct fields _must_ have a valid `json` tag to be included in the generated TypeScript. +Les champs Struct _doivent avoir_ le champ `json` de défini afin de pouvoir l'inclure dans le TypeScript généré. Les structures imbriquées anonymes ne sont pas supportées pour le moment. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/cli.mdx index ab4cb553..1c9bea69 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,22 +53,23 @@ Si vous n'êtes pas sûr d'un modèle, inspectez les fichiers `package.json` et |:-------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -clean | Nettoie le répertoire `build/bin` | | | -compiler "compiler" | Utiliser un autre compilateur pour compiler, par exemple go1.15beta1 | go | -| -debug | Conserve les informations de débogage dans l'application. Permet l'utilisation des outils de développement dans la fenêtre de l'application | | -| -dryrun | Prints the build command without executing it | | +| -debug | Conserve les informations de débogage dans l'application et affiche la console de débogage. Permet l'utilisation des outils de développement dans la fenêtre de l'application | | +| -devtools | Permet l'utilisation des devtools dans la fenêtre d'application en production (quand -debug n'est pas utilisé) | | +| -dryrun | Affiche la commande build sans l'exécuter | | | -f | Forcer la compilation de l'application | | | -garbleargs | Arguments à passer à garble | `-literals -tiny -seed=random` | | -ldflags "flags" | Options supplémentaires à passer au compilateur | | -| -m | Skip mod tidy before compile | | +| -m | Permet d'ignorer mod tidy avant la compilation | | | -nopackage | Ne pas empaqueter l'application | | -| -nocolour | Disable colour in output | | +| -nocolour | Désactive la couleur des logs dans le terminal | | | -nosyncgomod | Ne pas synchroniser go.mod avec la version Wails | | -| -nsis | Generate NSIS installer for Windows | | +| -nsis | Génère l'installateur NSIS pour Windows | | | -o filename | Nom du fichier de sortie | | | -obfuscated | Cacher le code de l'application en utilisant [garble](https://github.com/burrowers/garble) | | | -platform | Construit pour les [plates-formes](../reference/cli.mdx#platforms) données (séparées par des virgules) par exemple. `windows/arm64`. Notez que si vous ne donnez pas l'architecture, `runtime.GOARCH` est utilisé. | platform = le contenu de la variable d'environnement `GOOS` si elle existe, autrement `runtime.GOOS`.
arch = le contenu de la variable d'environnement `GOARCH` si elle existe, autrement `runtime.GOARCH`. | | -race | Construire avec le détecteur Go race | | | -s | Ignorer la construction du frontend | | -| -skipbindings | Skip bindings generation | | +| -skipbindings | Ignorer la génération des liaisons | | | -tags "extra tags" | Options de compilation à passer au compilateur Go. Doivent être entre guillemets. Séparés par un espace ou une virgule (pas les deux) | | | -trimpath | Supprimer tous les chemins vers les fichiers système de l'exécutable final. | | | -u | Met à jour le `go.mod de votre projet` pour utiliser la même version de Wails que le CLI | | @@ -88,7 +89,8 @@ Exemple: :::info -On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +Info +Sur Mac, l'application sera livrée avec `Info.plist`, pas `Info.dev.plist`. ::: @@ -164,11 +166,11 @@ Your system is ready for Wails development! - Un observateur est démarré et déclenchera une reconstruction de votre application de développement s'il détecte des changements dans vos fichiers go - Un serveur web est lancé sur `http://localhost:34115` qui sert votre application (et pas seulement le frontend) sur http. Cela vous permet d'utiliser les extensions de développement de votre navigateur favori - Tous les assets de l'application sont chargés à partir du disque. Si elles sont modifiées, l'application se rechargera automatiquement (pas de recompilation). Tous les navigateurs connectés rechargeront également -- A JS module is generated that provides the following: - - JavaScript wrappers of your Go methods with autogenerated JSDoc, providing code hinting - - TypeScript versions of your Go structs, that can be constructed and passed to your go methods -- A second JS module is generated that provides a wrapper + TS declaration for the runtime -- On macOS, it will bundle the application into a `.app` file and run it. It will use a `build/darwin/Info.dev.plist` for development. +- Un module JS est généré fournissant les éléments suivants : + - Les méthodes Javascript permettant d'appeler vos méthodes Go avec JSDoc autogénérée, vous fournissant des indications sur les méthodes + - Les versions TypeScript de vos structures Go, qui peuvent être construites et transmises à vos méthodes +- Un second module JS est généré qui fournit une déclaration des méthodes et structures pour l'exécutable +- Sur macOS, il regroupera l'application dans un fichier `.app` et l'exécutera. Il utilisera un `build/darwin/Info.dev.plist` pour le développement. | Option | Description | Par défaut | |:------------------------------------ |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:------------------------ | @@ -179,7 +181,7 @@ Your system is ready for Wails development! | -debounce | Le temps d'attente pour le rechargement après qu'une modification d'actif est détectée | 100 (millisecondes) | | -devserver "host:port" | L'adresse à laquelle lier le serveur de développement wails | "localhost:34115" | | -extensions | Extensions pour déclencher les rebuilds (séparés par des virgules) | go | -| -forcebuild | Force build of application | | +| -forcebuild | Force la compilation de l'application | | | -frontenddevserverurl "url" | Utiliser l'url du serveur de développement tiers pour servir les actifs, EG Vite | "" | | -ldflags "flags" | Options supplémentaires à passer au compilateur | | | -loglevel "loglevel" | Niveau de log à utiliser - Trace, Debug, Info, Warning, Error | Debug | @@ -190,7 +192,7 @@ Your system is ready for Wails development! | -reloaddirs | Répertoires supplémentaires pour déclencher les recharges (séparés par des virgules) | Valeur dans `wails.json` | | -s | Ignorer la construction du frontend | false | | -save | Sauvegarde les options `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` dans `wails.json` pour quelles deviennent les informations par défaut pour les prochaines utilisations. | | -| -skipbindings | Skip bindings generation | | +| -skipbindings | Ignorer la génération des liaisons | | | -tags "extra tags" | Options de construction à passer au compilateur (séparées par des guillemets et des espaces) | | | -v | Niveau de verbosité (0 - silencieux, 1 - par défaut, 2 - verbeux) | 1 | | -wailsjsdir | Le répertoire où stocker les modules JS Wails générés | Valeur dans `wails.json` | diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx index 89e2bcf4..1d3166ee 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,11 +362,38 @@ Indique quelle valeur le style `CSSDragProperty` doit avoir pour faire glisser l Nom: CSSDragValue
Type: `string` +### EnableDefaultContextMenu + +EnableDefaultContextMenu active le menu contextuel par défaut du navigateur en production. + +Par défaut, le menu contextuel par défaut du navigateur n'est disponible qu'en développement et dans un `-debug` ou `-devtools` [build](../reference/cli.mdx#build) avec l'inspecteur de devtools, En utilisant cette option, vous pouvez activer le menu contextuel par défaut dans `production` alors que l'inspecteur devtools ne sera pas disponible à moins que le drapeau `-devtools` ne soit utilisé. + +Lorsque cette option est activée, par défaut, le menu contextuel ne sera affiché que pour du texte (où Couper/Copier/Coller est nécessaire), pour remplacer ce comportement, vous pouvez utiliser la propriété CSS `--default-contextmenu` sur n'importe quel élément HTML (y compris le corps ``) avec les valeurs suivantes : + +| Style CSS | Comportement | +| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--default-contextmenu: auto;` | (**défaut**) n'affichera le menu contextuel par défaut que si :
contentEditable est vrai OU le texte a été sélectionné OU l'élément est entrée ou la zone de texte | +| `--default-contextmenu: show;` | affichera toujours le menu de contexte par défaut | +| `--default-contextmenu: hide;` | masquera toujours le menu contextuel par défaut | + +Cette règle est héritée comme n'importe quelle règle CSS normale, donc l'imbrication fonctionne comme prévu. + +:::note +Cette fonctionnalité de filtrage n'est activée qu'en production, donc en développement et en construction de débogage, le menu contextuel complet est toujours disponible partout. +::: + +:::warning +Cette fonctionnalité de filtrage n'est PAS une mesure de sécurité, le développeur devrait s'attendre à ce que le menu contextuel complet puisse être divulgué à tout moment qui pourrait contenir des commandes comme (Télécharger l'image, Recharger, Enregistrer la page web), si c'est une préoccupation, le développeur DEVRAIT NE PAS activer le menu contextuel par défaut. +::: + + +Nom: EnableDefaultContextMenu
Type: `bool` + ### EnableFraudulentWebsiteDetection -EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft. +EnableFraudulentWebWebDetection permet de rechercher des contenus frauduleux, tels que des programmes malveillants ou des tentatives d'hameçonnage. Ces services peuvent envoyer des informations à partir de votre application, telles que les URL vers lesquelles vous avez navigué et éventuellement d'autres contenus vers le cloud, des services d'Apple et de Microsoft. -Name: EnableFraudulentWebsiteDetection
Type: `bool` +Nom: EnableFraudulentWebsiteDetection
Type: `bool` ### ZoomFactor @@ -383,6 +413,12 @@ La liste des structs Go définissant des méthodes qui doivent être liées au f Nom: Bind
Type: `[]interface{}` +### ErrorFormatter + +Une fonction qui détermine comment les erreurs sont formatées lorsqu'elles sont retournées par un appel de méthode JS-to-Go. La valeur retournée sera sous format JSON. + +Nom: ErrorFormatter
Type: `func (error) any` + ### Windows Ceci définit les options [spécifiques à Windows](#windows). @@ -553,9 +589,9 @@ Nom: OnResume
Type: `func()` #### WebviewGpuIsDisabled -Setting this to `true` will disable GPU hardware acceleration for the webview. +Définir ceci à `true` désactivera l'accélération matérielle GPU pour la webview. -Name: WebviewGpuIsDisabled
Type: `bool` +Nom: WebviewGpuIsDisabled
Type: `bool` ### Mac @@ -739,17 +775,25 @@ Nom: WindowIsTranslucent
Type: `bool` #### WebviewGpuPolicy -This option is used for determining the webview's hardware acceleration policy. +Cette option est utilisée pour déterminer la politique d'accélération matérielle effectuée par webview. -Name: WebviewGpuPolicy
Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy-type)
Default: `WebviewGpuPolicyAlways` +Nom: WebviewGpuPolicy
Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy-type)
Défaut: `WebviewGpuPolicyAlways` -##### WebviewGpuPolicy type +##### Type de WebviewGpuPolicy -| Valeur | Description | -| ------------------------ | -------------------------------------------------------------------- | -| WebviewGpuPolicyAlways | Hardware acceleration is always enabled | -| WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents | -| WebviewGpuPolicyNever | Hardware acceleration is always disabled | +| Valeur | Description | +| ------------------------ | ---------------------------------------------------------------------------- | +| WebviewGpuPolicyAlways | L'accélération matérielle est toujours activée | +| WebviewGpuPolicyOnDemand | L'accélération matérielle est activée/désactivée à la demande du contenu web | +| WebviewGpuPolicyNever | L'accélération matérielle est toujours désactivée | + +#### ProgramName + +This option is used to set the program's name for the window manager via GTK's g_set_prgname(). This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html). + +When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name` property differs form the executable's filename. + +Name: ProgramName
Type: string
### Debug @@ -763,5 +807,5 @@ Définir cette option à `true` ouvrira l'inspecteur Web au démarrage de l'appl Nom: OpenInspectorOnStartup
Type: `bool` -[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. -[^2]: This requires WebKit2GTK 2.40+ support and your app needs to be build with the build tag `webkit2_40` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.40 for your app. +[^1]: Cela nécessite la prise en charge de WebKit2GTK 2.36+ et votre application doit être construite avec la balise de compilation `webkit2_36` pour activer le support de cette fonctionnalité. Cela augmente aussi la version minnimale de WebKit2GTK à 2.36 pour votre application. +[^2]: Cela nécessite la prise en charge de WebKit2GTK 2.40+ et votre application doit être construite avec la balise de compilation `webkit2_40` pour activer le support de cette fonctionnalité. Cela augmente aussi la version minnimale de WebKit2GTK à 2.40 pour votre application. [ [ ↩](#fnref2:2){.footnote-backref} ↩](#fnref:2){.footnote-backref} diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 5c7d578b..a5f067dd 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -2,11 +2,11 @@ sidebar_position: 5 --- -# Project Config +# Configuration du projet -The project config resides in the `wails.json` file in the project directory. The structure of the config is: +La configuration du projet se trouve dans le fichier `wails.json` du répertoire du projet. La structure de la configuration est : -```json +```json5 { // Project config version "version": "", diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/clipboard.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/clipboard.mdx index 805f68ed..c37399d0 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/clipboard.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/clipboard.mdx @@ -4,20 +4,20 @@ sidebar_position: 8 # Clipboard -This part of the runtime provides access to the operating system's clipboard.
The current implementation only handles text. +Cette partie du runtime fournit un accès au presse-papiers du système d'exploitation.
L'implémentation actuelle ne gère que le texte. ### ClipboardGetText -This method reads the currently stored text from the clipboard. +Cette méthode lit le texte actuellement stocké dans le presse-papiers. -Go: `ClipboardGetText(ctx context.Context) (string, error)`
Returns: a string (if the clipboard is empty an empty string will be returned) or an error. +Go: `ClipboardGetText(ctx context.Context) (string, error)`
Retourne: une chaîne de caractères (si le presse papier est vide, il retournera une chaîne vide) ou une erreur. -JS: `ClipboardGetText(): Promise`
Returns: a promise with a string result (if the clipboard is empty an empty string will be returned). +JS: `ClipboardGetText(): Promise`
Retourne : Un promise d'une chaine de caractères (si le presse papier est vide, il retournera une chaîne vide). ### ClipboardSetText -This method writes a text to the clipboard. +Cette méthode écrit du texte dans le presse-papiers. -Go: `ClipboardSetText(ctx context.Context, text string) error`
Returns: an error if there is any. +Go: `ClipboardSetText(ctx context.Context, text string) error`
Retourne: Une erreur si il y en a une. -JS: `ClipboardSetText(text: string): Promise`
Returns: a promise with true result if the text was successfully set on the clipboard, false otherwise. +JS: `ClipboardSetText(text: string): Promise`
Retourne: Un promise avec true si le texte a été écrit avec succès dans le presse papier, autrement il contiendra false. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..457c92eb --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# Screen + +These methods provide information about the currently connected screens. + +### ScreenGetAll + +Returns a list of currently connected screens. + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### Screen + +Go struct: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript interface: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index 03313236..e9d915a4 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` Définit la largeur et la hauteur de la fenêtre. -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowGetSize @@ -116,7 +116,7 @@ Définit la taille minimale de la fenêtre. Redimensionnera la fenêtre si la fe Définir une taille de `0,0` désactivera cette contrainte. -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize @@ -124,7 +124,7 @@ Définit la taille maximale de la fenêtre. Redimensionnera la fenêtre si la fe Définir une taille de `0,0` désactivera cette contrainte. -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway Définit la position de la fenêtre par rapport au moniteur sur lequel la fenêtre est activée. -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition @@ -200,6 +200,12 @@ Sous Windows, seules les valeurs 0 et 255 sont prises en charge pour A. Toute va Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## Définitions d'objets TypeScript ### Position diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index 8618dbef..2beff220 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.5.0.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.5.0.json index c7fb70c8..22e92d45 100644 --- a/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.5.0.json +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.5.0.json @@ -4,23 +4,23 @@ "description": "The label for version v2.5.0" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "Premiers pas", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "Référence", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { - "message": "Runtime", + "message": "Exécution", "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "Communauté", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { - "message": "Showcase", + "message": "Galerie", "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { @@ -28,11 +28,11 @@ "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "Tutoriels", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "Contribuer", "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" } } diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx index e2073d6f..f8f9c2ff 100644 --- a/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +## v2.6.0 - 2023-09-06 + +### Modifications importantes + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### Corrections -- Avoid app crashing when the Linux GTK key is empty by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### Ajouts + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### Changements +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 @@ -148,8 +179,8 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Amélioration du message d'erreur si aucun `index.html` ne peut être trouvé dans les assets et de la validation des options d'assetserver. Changé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2110) - Promotion de Go WebView2Loader d'expérimental à stable. Cela signifie que maintenant, par défaut, toutes les constructions de Wails utilisent le nouveau chargeur introduit avec `v2.2.0`. L'ancien chargeur reste utilisable avec la balise de compilation `native_webview2loader` pour les prochaines versions. Changé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2199) -- Refactored CLI. Changed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2123) -- Remove unreachable code. Changed by @tmclane in this [PR](https://github.com/wailsapp/wails/pull/2182) +- Restructuration du CLI. Modifié par @leaanthony dans cette [PR](https://github.com/wailsapp/wails/pull/2123) +- Suppression de code injoignable. Modifié par @tmclane dans cette [PR](https://github.com/wailsapp/wails/pull/2182) ## v2.2.0 - 2022-11-09 diff --git a/website/i18n/fr/docusaurus-theme-classic/footer.json b/website/i18n/fr/docusaurus-theme-classic/footer.json index 47b07b4c..ea741cd0 100644 --- a/website/i18n/fr/docusaurus-theme-classic/footer.json +++ b/website/i18n/fr/docusaurus-theme-classic/footer.json @@ -56,7 +56,7 @@ "description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf" }, "logo.alt": { - "message": "Wails Logo", + "message": "Logo Wails", "description": "The alt text of footer logo" } } diff --git a/website/i18n/fr/docusaurus-theme-classic/navbar.json b/website/i18n/fr/docusaurus-theme-classic/navbar.json index 4aa41884..f0404d5e 100644 --- a/website/i18n/fr/docusaurus-theme-classic/navbar.json +++ b/website/i18n/fr/docusaurus-theme-classic/navbar.json @@ -40,7 +40,7 @@ "description": "Navbar item with label Code of Conduct" }, "logo.alt": { - "message": "Wails Logo", + "message": "Logo Wails", "description": "The alt text of navbar logo" } } diff --git a/website/i18n/ja/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx b/website/i18n/ja/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx index 9a137d09..279530f7 100644 --- a/website/i18n/ja/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-blog/2023-01-17-v3-roadmap.mdx @@ -1,6 +1,6 @@ --- slug: the-road-to-wails-v3 -title: The Road to Wails v3 +title: Wails v3 ロードマップ authors: - leaanthony tags: @@ -18,61 +18,61 @@ tags:
``` -# Introduction +# イントロダクション -Wails is a project that simplifies the ability to write cross-platform desktop applications using Go. It uses native webview components for the frontend (not embedded browsers), bringing the power of the world's most popular UI system to Go, whilst remaining lightweight. +Wailsは、Goを使用してクロスプラットフォームなデスクトップアプリケーションを簡単に開発できるようにするプロジェクトです。 フロントエンドに (埋め込みブラウザではなく) ネイティブなWebViewコンポーネントを採用し、軽量でありながら、世界で最も人気のあるUIシステムのパワーをGoにもたらしています。 -Version 2 was released on the 22nd of September 2022 and brought with it a lot of enhancements including: +バージョン2は2022年9月22日にリリースされ、次のような多くの機能強化が行われました: -- Live development, leveraging the popular Vite project -- Rich functionality for managing windows and creating menus -- Microsoft's WebView2 component -- Generation of Typescript models that mirror your Go structs -- Creating of NSIS Installer -- Obfuscated builds +- ポピュラーなViteプロジェクトを活用したライブ開発 +- ウィンドウの管理やメニュー作成のための豊富な機能 +- MicrosoftのWebView2の採用 +- Go構造体をミラーリングしたTypeScript型定義の生成 +- NSISインストーラの作成 +- 難読化ビルド -Right now, Wails v2 provides powerful tooling for creating rich, cross-platform desktop applications. +現在、Wails v2は、リッチでクロスプラットフォームなデスクトップアプリケーションを作成するための、強力なツールを提供しています。 -This blog post aims to look at where the project is at right now and what we can improve on moving forward. +この記事は、プロジェクトが現在どのような状況にあるのか、そして、今後どう改善していくべきなのかを検討するために投稿されました。 -# Where are we now? +# 私たちは今どういう状況なのか? -It's been incredible to see the popularity of Wails rising since the v2 release. I'm constantly amazed by the creativity of the community and the wonderful things that are being built with it. With more popularity, comes more eyes on the project. And with that, more feature requests and bug reports. +v2をリリースして以降、信じられないほどWailsの人気は上昇しています。 コミュニティの創造性と、それをもとに構築された素晴らしいものには、私はいつも驚かされています。 人気が高まるにつれて、このプロジェクトへの注目度も高まっています。 よって、機能リクエストやバグレポートの件数も増えてきています。 -Over time, I've been able to identify some of the most pressing issues facing the project. I've also been able to identify some of the things that are holding the project back. +時間が経つにつれて、私は、プロジェクトが直面しているいくつかの重要な課題を特定することができました。 また、プロジェクトの進行を妨げている要因についても特定することができました。 -## Current issues +## 現在の課題 -I've identified the following areas that I feel are holding the project back: +プロジェクトの妨げになっていると考えられる要素は次のとおりです: -- The API -- Bindings generation -- The Build System +- API +- バインディングの生成 +- ビルドシステム -### The API +### API -The API to build a Wails application currently consists of 2 parts: +Wailsのアプリケーションを構築するためのAPIは、現在、2つの種類で構成されています: -- The Application API -- The Runtime API +- アプリケーションAPI +- ランタイムAPI -The Application API famously has only 1 function: `Run()` which takes a heap of options which govern how the application will work. Whilst this is very simple to use, it is also very limiting. It is a "declarative" approach which hides a lot of the underlying complexity. For instance, there is no handle to the main window, so you can't interact with it directly. For that, you need to use the Runtime API. This is a problem when you start to want to do more complex things like create multiple windows. +ご存じのとおり、アプリケーションAPIは`Run()`という1つの関数しかなく、アプリケーションの動作を制御するたくさんのオプションを引数で指定します。 これはシンプルで使いやすい反面、制限の多々あります。 要因としてあるのは、これが根本的な複雑さを隠してしまう"宣言的"アプローチであるという点です。 たとえば、メインウィンドウのハンドルが存在しないため、メインウィンドウを直接操作することはできません。 操作するには、ランタイムAPIを使用する必要があります。 この仕様は、複数のウィンドウを作成するときなど、より複雑なことをしたいときに課題となります。 -The Runtime API provides a lot of utility functions for the developer. This includes: +ランタイムAPIは、開発者に多くのユーティリティ関数を提供します。 次のようなものです: -- Window management -- Dialogs -- Menus -- Events -- Logs +- ウィンドウ管理 +- ダイアログ +- メニュー +- イベント +- ログ -There are a number of things I am not happy with the Runtime API. The first is that it requires a "context" to be passed around. This is both frustrating and confusing for new developers who pass in a context and then get a runtime error. +ランタイムAPIには、不満な点がいくつかあります。 その1つは、"context"を渡す必要があるということです。 これは、contextを渡して実行時エラーを発生させてしまう新しい開発者をイライラさせるだけでなく、混乱を招くもとでもあります。 -The biggest issue with the Runtime API is that it was designed for applications that only use a single window. Over time, the demand for multiple windows has grown and the API is not well suited to this. +そして、ランタイムAPIの最大の問題は、APIが1つのウィンドウのみを使用するアプリケーション向けに設計されているということです。 時が経つにつれて、複数ウィンドウに対する需要は多くなってきており、現在のAPIはこれにあまり適していません。 -### Thoughts on the v3 API +### v3 APIの考え方 -Wouldn't it be great if we could do something like this? +こんなことができたら素晴らしいと思いませんか? ```go func main() { @@ -86,7 +86,7 @@ func main() { } ``` -This programmatic approach is far more intuitive and allows the developer to interact with the application elements directly. All current runtime methods for windows would simply be methods on the window object. For the other runtime methods, we could move them to the application object like so: +この手続き型のアプローチははるかに直感的で、開発者はアプリケーションの要素を直接操作することができます。 ウィンドウ向けのすべてのランタイムメソッドは、単純なウィンドウオブジェクトのメソッドにかわります。 他のランタイムメソッドは、次のようにアプリケーションオブジェクトに移動されます: ```go app := wails.NewApplication(options.App{}) @@ -94,7 +94,7 @@ app.NewInfoDialog(options.InfoDialog{}) app.Log.Info("Hello World") ``` -This is a much more powerful API which will allow for more complex applications to be built. It also allows for the creation of multiple windows, [the most up-voted feature on GitHub](https://github.com/wailsapp/wails/issues/1480): +これは、より複雑なアプリケーションの構築を可能にする、より強力なAPIとなります。 そして、[GitHubで最も待ち望まれていた機能である](https://github.com/wailsapp/wails/issues/1480)、複数のウィンドウの作成も可能となります: ```go func main() { @@ -113,7 +113,7 @@ func main() { } ``` -### Bindings generation +### バインディングの生成 One of the key features of Wails is generating bindings for your Go methods so they may be called from Javascript. The current method for doing this is a bit of a hack. It involves building the application with a special flag and then running the resultant binary which uses reflection to determine what has been bound. This leads to a bit of a chicken and egg situation: You can't build the application without the bindings and you can't generate the bindings without building the application. There are many ways around this but the best one would be not to use this approach at all. @@ -121,7 +121,7 @@ There was a number of attempts at writing a static analyser for Wails projects b Compared to reflection, the AST approach is much faster however it is significantly more complicated. To start with, we may need to impose certain constraints on how to specify bindings in the code. The goal is to support the most common use cases and then expand it later on. -### The Build System +### ビルドシステム Like the declarative approach to the API, the build system was created to hide the complexities of building a desktop application. When you run `wails build`, it does a lot of things behind the scenes: - Builds the backend binary for bindings and generates the bindings @@ -161,11 +161,11 @@ Benefits to the project maintainers are: - The new build system will be much easier to maintain and extend. I hope this will lead to a new ecosystem of community driven build pipelines. - Better separation of concerns within the project. This will make it easier to add new features and platforms. -## The Plan +## 計画 A lot of the experimentation for this has already been done and it's looking good. There is no current timeline for this work but I'm hoping by the end of Q1 2023, there will be an alpha release for Mac to allow the community to test, experiment with and provide feedback. -## Summary +## まとめ - The v2 API is declarative, hides a lot from the developer and not suitable for features such as multiple windows. A new API will be created which will be simpler, intuitive and more powerful. - The build system is opaque and difficult to customise so we will move to an external build system which will open it all up. diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx index bc569c3f..a9d9ad65 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx @@ -7,10 +7,10 @@

``` -[FileHound Export Utility](https://www.filehound.co.uk/) FileHound is a cloud document management platform made for secure file retention, business process automation and SmartCapture capabilities. +[FileHound Export Utility](https://www.filehound.co.uk/) FileHoundは、安全なファイル保管、ビジネスプロセスの自動化、およびSmartCapture機能のための、クラウドドキュメント管理プラットフォームです。 -The FileHound Export Utility allows FileHound Administrators the ability to run a secure document and data extraction tasks for alternative back-up and recovery purposes. This application will download all documents and/or meta data saved in FileHound based on the filters you choose. The metadata will be exported in both JSON and XML formats. +FileHound Export Utilityを使用すると、FileHoundの管理者はバックアップやリカバリのために、安全なドキュメントとデータ抽出タスクを実行できます。 このアプリケーションは、選択したフィルタにもとづいて、FileHoundに保存されているすべての文書やメタデータをダウンロードします。 メタデータはJSON形式とXML形式の両方でエクスポートされます。 -Backend built with: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2 +バックエンド: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2 -Frontend with: Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6 +フロントエンド: Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx index 87e5837d..611c60d5 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/hiposter.mdx @@ -7,4 +7,4 @@

``` -[hiposter](https://github.com/obity/hiposter) is a simple and efficient http API testing client tool. Based on Wails, Go and sveltejs. +[hiposter](https://github.com/obity/hiposter)は、シンプルで効率的に使用できる、http APIテストクライアントツールです。 Wails、Go、sveltejsで構築されました。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx index 2f6c7c72..668173eb 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx @@ -11,4 +11,4 @@

``` -[Minecraft Updater](https://github.com/Gurkengewuerz/MinecraftModUpdater) is a utility tool to update and synchronize Minecraft mods for your userbase. It’s built using Wails2 and React with [antd](https://ant.design/) as frontend framework. +[Minecraft Updater](https://github.com/Gurkengewuerz/MinecraftModUpdater)は、ユーザベースMinecraft Modを更新および同期するためのユーティリティツールです。 Wails2とReactで構築されており、フロントエンドフレームワークには[antd](https://ant.design/)を使用しています。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx index bcd21239..a8020f6b 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -9,6 +9,6 @@

``` -[Modal File Manager](https://github.com/raguay/ModalFileManager) is a dual pane file manager using web technologies. My original design was based on NW.js and can be found [here](https://github.com/raguay/ModalFileManager-NWjs). This version uses the same Svelte based frontend code (but it has be greatly modified since the departure from NW.js), but the backend is a [Wails 2](https://wails.io/) implementation. By using this implementation, I no longer use command line `rm`, `cp`, etc. commands, but a git install has to be on the system to download themes and extensions. It is fully coded using Go and runs much faster than the previous versions. +[Modal File Manager](https://github.com/raguay/ModalFileManager)は、Web技術を使用した、デュアルペインファイルマネージャです。 [こちら](https://github.com/raguay/ModalFileManager-NWjs)でもともと公開していたNW.jsで構築されたものをベースとしています。 本バージョンでは、フロントエンドのコードには前と同様にSvelteを使用(NW.jsを使用していた時から大幅な修正はありました)しましたが、バックエンドの実装にはWails 2を使用しました。 この実装によって、コマンドラインの`rm`、`cp`などのコマンドを使用しなくなりましたが、テーマや拡張機能のダウンロードのために、システム上でgitのインストールは必要となります。 Goで完全にコード化されており、以前のバージョンよりもはるかに高速に実行されます。 -This file manager is designed around the same principle as Vim: a state controlled keyboard actions. The number of states isn't fixed, but very programmable. Therefore, an infinite number of keyboard configurations can be created and used. This is the main difference from other file managers. There are themes and extensions available to download from GitHub. +このファイルマネージャは、Vimと同じ、状態制御キーボード操作の原理に基づいて設計されています。 状態の数に制限はなく、とてもプログラマブルです。 つまり、無数にキーボード構成を作成・使用することができます。 この点は、他のファイルマネージャとの主な違いと言えるでしょう。 また、GitHubからテーマや拡張機能をダウンロードできます。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx index 5d846d06..00159268 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx @@ -7,4 +7,4 @@

``` -[Molly Wallet](https://github.com/grvlle/constellation_wallet/) the official $DAG wallet of the Constellation Network. It'll let users interact with the Hypergraph Network in various ways, not limited to producing $DAG transactions. +[Molly Wallet](https://github.com/grvlle/constellation_wallet/)は、Constellation Networkの公式$DAGウォレットです。 ユーザは、$DAGトランザクションの生成に限らず、様々な方法でHypergraph Networkとやり取りすることができます。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/october.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/october.mdx index 66d634dc..7b5f59d1 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/october.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/october.mdx @@ -7,8 +7,8 @@

``` -[October](https://october.utf9k.net) is a small Wails application that makes it really easy to extract highlights from [Kobo eReaders](https://en.wikipedia.org/wiki/Kobo_eReader) and then forward them to [Readwise](https://readwise.io). +[October](https://october.utf9k.net)は、[Kobo eReaders](https://en.wikipedia.org/wiki/Kobo_eReader)からハイライトを抽出し、簡単に[Readwise](https://readwise.io)へ転送できる、シンプルなWailsアプリケーションです。 -It has a relatively small scope with all platform versions weighing in under 10MB, and that's without enabling [UPX compression](https://upx.github.io/)! +[UPX圧縮](https://upx.github.io/)なしで、すべてのプラットフォームで10MB以下という、比較的小さなサイズとなっています! -In contrast, the author's previous attempts with Electron quickly bloated to several hundred megabytes. +これとは対照的に、開発者が以前にElectronで作成したものは、簡単に数百MBにまで膨らんでしまいました。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx index 4f87479d..b02394d2 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx @@ -7,4 +7,4 @@

``` -[Optimus](https://github.com/splode/optimus) is a desktop image optimization application. It supports conversion and compression between WebP, JPEG, and PNG image formats. +[Optimus](https://github.com/splode/optimus)は、画像最適化のためのデスクトップアプリケーションです。 WebP、JPEG、PNG形式画像の相互変換や圧縮をサポートしています。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx index 03e740f4..3066a979 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx @@ -7,4 +7,4 @@

``` -[Portfall](https://github.com/rekon-oss/portfall) - A desktop k8s port-forwarding portal for easy access to all your cluster UIs +[Portfall](https://github.com/rekon-oss/portfall) - すべてのクラスタUIに簡単にアクセスできる、デスクトップk8s port-forwardingポータルです。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx index 3646384e..348ffdd5 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx @@ -9,4 +9,4 @@

``` -[Restic-Browser](https://github.com/emuell/restic-browser) - A simple, cross-platform [restic](https://github.com/restic/restic) backup GUI for browsing and restoring restic repositories. +[Restic-Browser](https://github.com/emuell/restic-browser) - resticリポジトリを参照およびリストアするための、シンプルでクロスプラットフォームな[restic](https://github.com/restic/restic)バックアップGUIツールです。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx index 9928b478..b1e66ae7 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx @@ -7,15 +7,15 @@

``` -Easy, Secure, and Free file sharing for everyone. Learn more at [Riftshare.app](https://riftshare.app) +誰にとっても簡単、安全、そして無料のファイル共有。 詳しくは[Riftshare.app](https://riftshare.app)をご覧ください。 -## Features +## 機能 -- Easy secure file sharing between computers both in the local network and through the internet -- Supports sending files or directories securely through the [magic wormhole protocol](https://magic-wormhole.readthedocs.io/en/latest/) -- Compatible with all other apps using magic wormhole (magic-wormhole or wormhole-william CLI, wormhole-gui, etc.) -- Automatic zipping of multiple selected files to send at once -- Full animations, progress bar, and cancellation support for sending and receiving -- Native OS File Selection -- Open files in one click once received -- Auto Update - don't worry about having the latest release! +- ローカルネットワーク内またはインターネット経由で、簡単にセキュアなコンピュータ間ファイル共有が可能 +- [magic wormhole プロトコル](https://magic-wormhole.readthedocs.io/en/latest/)を介したファイル・ディレクトリのセキュアな送信をサポート +- magic wormholeを使用する他のすべてのアプリ(magic-wormhole、wormhole-william CLI、wormhole-guiなど) との互換性 +- 選択された複数ファイルを自動圧縮して一括送信 +- フルアニメーション、プログレスバー、および送受信のキャンセルをサポート +- OSネイティブのファイル選択UIを利用可能 +- 受信したファイルをワンクリックで開ける +- 自動アップデート - 最新のリリースを気にする必要はありません! diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx index 3e41eb32..9ab6d88d 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -7,4 +7,4 @@

``` -[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) is a program to show the output of scripts or [Node-Red](https://nodered.org) server. It runs scripts defined in EmailIt program and shows the output. Scripts from xBar or TextBar can be used, but currently on the TextBar scripts work well. It also displays the output of scripts on your system. ScriptBar doesn't put them in the menubar, but has them all in a convient window for easy viewing. You can have multiple tabs to have many different things show. You can also keep the links to your most visited web sites. +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp)は、スクリプトまたは[Node-Red](https://nodered.org)サーバの出力を表示するためのプログラムです。 EmailItプログラムで定義されたプログラムを実行し、出力を表示します。 xBarやTextBarのスクリプトも使用できますが、現時点ではTextBarのスクリプトが正常に動作します。 また、システム上にスクリプトの出力を表示できます。 ScriptBarはそれらの情報をメニューバーには表示させず、簡単に参照できる便利なウィンドウ上に表示されます。 複数のタブを使用して、様々な情報を表示できます。 よくアクセスするWebサイトへのリンクを配置することもできます。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx index c3b3fb4c..bcca578e 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx @@ -7,4 +7,4 @@

``` -[Surge](https://getsurge.io/) is a p2p filesharing app designed to utilize blockchain technologies to enable 100% anonymous file transfers. Surge is end-to-end encrypted, decentralized and open source. +[Surge](https://getsurge.io/)は、ブロックチェーン技術を使用して、100%匿名でのファイル転送ができるように設計された、p2pファイル共有アプリです。 エンドツーエンド暗号化に対応、分散型、そしてオープンソースである点が、Surgeの特徴です。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx index 7408aa58..d44b2280 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx @@ -7,4 +7,4 @@

``` -[Wally](https://ergodox-ez.com/pages/wally) is the official firmware flasher for [Ergodox](https://ergodox-ez.com/) keyboards. It looks great and is a fantastic example of what you can achieve with Wails: the ability to combine the power of Go and the rich graphical tools of the web development world. +[Wally](https://ergodox-ez.com/pages/wally)は、[Ergodox](https://ergodox-ez.com/)キーボード公式の、ファームウェアフラッシャーです。 とても見栄えが良く、GoのパワーとWeb開発技術の豊富なグラフィカルツールを組み合わせるという、Wailsで達成できる機能を示す良い例となるアプリです。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx index 950dc3f3..6674a7d1 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/warmine.mdx @@ -12,8 +12,8 @@

``` -[Minecraft launcher for WarMine](https://warmine.ru/) is a Wails application, that allows you to easily join modded game servers and manage your game accounts. +[Minecraft launcher for WarMine](https://warmine.ru/)は、Modを導入したゲームサーバに簡単にアクセスしたり、ゲームアカウントを管理できるWailsアプリケーションです。 -The Launcher downloads the game files, checks their integrity and launches the game with a wide range of customization options for the launch arguments from the backend. +ランチャーでは、ゲームファイルをダウンロードし、その整合性のチェックして、様々なカスタマイズが可能なバックエンドからの起動引数を使用してゲームを起動します。 -Frontend is written in Svelte, whole launcher fits in 9MB and supports Windows 7-11. +フロントエンドはSvelteで記述され、ランチャー全体は9MBに収まり、Windows 7-11をサポートしています。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx index f100c55e..eedc72d9 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx @@ -7,4 +7,4 @@

``` -[Wombat](https://github.com/rogchap/wombat) is a cross platform gRPC client. +[Wombat](https://github.com/rogchap/wombat)はクロスプラットフォーム対応のgRPCクライアントです。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx index 5db428f7..94e0e09f 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx @@ -7,4 +7,4 @@

``` -[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails) is an app for downloading tracks from youtube, creating offline playlists and share them with your friends, your friends will be able to playback your playlists or download them for offline listening, has an built-in player. +[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails)はYouTubeからトラックをダウンロードしたり、オフラインプレイリストを作成して友達と共有するためのアプリです。友達は、あなたのプレイリストを内蔵プレーヤーで再生したり、オフラインで聴くためにダウンロードしたりできます。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx index 947c93ab..9fc4a8d9 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ sidebar_position: 1 - [wails-react-template](https://github.com/flin7/wails-react-template) - ライブ開発をサポートしたReactの最小テンプレート - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - Next.js、TypeScript を使用したテンプレート - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - React + TypeScript + Vite + TailwindCSSを使用したテンプレート +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - Vite、React、TypeScript、TailwindCSS、shadcn/uiを使用したテンプレート ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - Svelteを使用したテンプレート - [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - SvelteおよびViteを使用したテンプレート - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - TailwindCSS v3を含んだ、SvelteおよびViteを使用したテンプレート +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - SvelteKitを使用したテンプレート ## Solid diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/application-development.mdx index 8deaff12..850d85f3 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ Wails v2では必要に応じて、`options.App`の中に`http.Handler`を定義 ## 外部開発サーバ -フレームワークによっては独自のライブリロードサーバが付属しているものがありますが、それらはWailsのGoバインディングを使用することができません。 このような場面では、Wailsが監視するビルドディレクトリ内で、プロジェクトをリビルドする監視スクリプトを実行すると良いでしょう。 例としては、[rollup](https://rollupjs.org/guide/en/)を使用するデフォルトのsvelteテンプレートをご覧ください。 また[create-react-app](https://create-react-app.dev/)を使用する場合、[このスクリプト](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd)を使用すると同様の結果を得ることができます。 +フレームワークによっては独自のライブリロードサーバが付属しているものがありますが、それらはWailsのGoバインディングを使用することができません。 このような場面では、Wailsが監視するビルドディレクトリ内で、プロジェクトをリビルドする監視スクリプトを実行すると良いでしょう。 例としては、[rollup](https://rollupjs.org/guide/en/)を使用するデフォルトのsvelteテンプレートをご覧ください。 + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Goモジュール diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index 458e636f..0746f225 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ XCodeコマンドラインツールの再インストールが引き続き失敗 ## ビルドプロセスが"Generating bindings"で停止します バインディングの生成プロセスは、アプリケーションを特別なモードで実行します。 アプリケーションに、意図に有無にかかわらず無限ループ(`wails.Run()`のあとに終了されないコード)が含まれている場合、バインディングの生成の段階でビルドプロセスが停止する可能性があります。 コードが正しく終了していることを確認してください。 + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/cli.mdx index 5c3f7728..6c83ddd9 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,7 +53,8 @@ WailsではGitHubでホストされているリモートテンプレートをサ |:-------------------- |:-------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | | -clean | `build/bin`ディレクトリをクリーンする | | | -compiler "compiler" | 違うGoコンパイラを使用する。例: go1.15beta1 | go | -| -debug | アプリケーションのデバッグ情報を保持する。 これにより、アプリケーションウィンドウで開発者ツールを使用することを許可できます。 | | +| -debug | アプリケーションのデバッグ情報を保持し、デバッグコンソールを表示する。 これにより、アプリケーションウィンドウで開発者ツールを使用することを許可できます。 | | +| -devtools | 本番用のアプリケーションウィンドウにおいて開発者ツールの使用を許可する (-debugが使用されていないとき) | | | -dryrun | 実際には実行せずにbuildコマンドの結果を表示する | | | -f | アプリケーションを強制的にビルド | | | -garbleargs | garbleへ渡す引数 | `-literals -tiny -seed=random` | diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx index 82ee092f..8f9a73bb 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,6 +362,33 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { 名前: CSSDragValue
データ型: `string` +### EnableDefaultContextMenu + +EnableDefaultContextMenuは、本番環境において、ブラウザのデフォルトコンテキストメニューを有効にします。 + +通常、ブラウザのデフォルトコンテキストメニューは、開発環境での動作時、または`-debug`・`-devtools`フラグをつけて開発者ツールを有効にして[ビルド](../reference/cli.mdx#build)したときのみ利用できますが、本オプションを使うと、`-devtools`フラグをつけない限り開発者ツールは使用できませんが、`本番`環境でもコンテキストメニューを有効にすることができます。 + +このオプションを有効にすると、デフォルトでは、テキストに関するコンテキスト(切り取り/コピー/貼り付け) のみがコンテキストメニューに表示されます。この動作をオーバーライドするには、`--default-contextmenu`というCSSプロパティを任意のHTML要素(`body`含む) で以下の値と共に使用してください: + +| CSSスタイル | 動作 | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `--default-contextmenu: auto;` | (**デフォルト**) 次の場合にのみデフォルトのコンテキストメニューを表示します:
contentEditableがtrueである、またはテキストが選択されている、またはinput要素/textarea要素であるとき | +| `--default-contextmenu: show;` | 常にデフォルトのコンテキストメニューを表示します | +| `--default-contextmenu: hide;` | 常にデフォルトのコンテキストメニューを非表示にします | + +このルールは通常のCSSルールと同様に継承されるため、ネストも期待どおりに動作します。 + +:::note +このフィルタリング機能は本番環境でのみ有効であり、開発・デバッグビルドでは、フルコンテキストメニューが常に使用できます。 +::: + +:::warning +このフィルタリング機能はセキュリティ対策として使用することはできません。開発者は、画像のダウンロード、リロード、ウェブページの保存といったコマンドを含むフルコンテキストメニューが常にリークされる可能性を考慮すべきです。この点が気になる場合、開発者はデフォルトのコンテキストメニューを有効にするべきではありません。 +::: + + +名前: EnableDefaultContextMenu
データ型: `bool` + ### EnableFraudulentWebsiteDetection EnableFraudulentWebsiteDetectionは、マルウェアやフィッシング詐欺などの不正コンテンツのスキャンサービスを有効にします。 これらのサービスは、ナビゲートされたURLやその他コンテンツ情報を、アプリからAppleおよびMicrosoftのクラウドサービスに送信する可能性があります。 @@ -383,6 +413,12 @@ WebView2の拡大率を定義します。 これは、Edgeのユーザによる 名前: Bind
データ型: `[]interface{}` +### ErrorFormatter + +JSからGoへ呼び出されたメソッドがエラーを返す際に、エラーをフォーマットする関数です。 返り値はJSONとして変換されます。 + +名前: ErrorFormatter
データ型: `func (error) any` + ### Windows [Windows固有のオプション](#windows)を定義します。 @@ -751,6 +787,14 @@ func main() { | WebviewGpuPolicyOnDemand | Webコンテンツからの要求に応じて、ハードウェアアクセラレーションの有効/無効を切り替える | | WebviewGpuPolicyNever | ハードウェアアクセラレーションを常に無効にする | +#### ProgramName + +このオプションでは、GTKのg_set_prgname() を使用し、ウィンドウマネージャのプログラム名を設定することができます。 ただし、ローカライズされた名前を設定すべきではありません。詳しくは[ドキュメント](https://docs.gtk.org/glib/func.set_prgname.html)をご覧ください。 + +.desktopファイルが作成される際、.desktopファイルの`Name`オプションと実行ファイルのファイル名が異なる場合に、ウィンドウのグループ化およびデスクトップアイコンの表示に、本オプションは役立ちます。 + +名前: ProgramName
データ型: string
+ ### Debug デバッグビルド時に適用される[デバッグ固有のオプション](#Debug)を定義します。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 3f81a22e..514c48c4 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -6,7 +6,7 @@ sidebar_position: 5 プロジェクト構成は、プロジェクトディレクトリ内の`wails.json`ファイルで設定します。 ファイルの構造は次のとおりです: -```json +```json5 { // プロジェクト構成のバージョン。 "version": "", diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..954c407d --- /dev/null +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# スクリーン + +これらのメソッドは、現在接続されているスクリーンに関する情報を提供します。 + +### ScreenGetAll + +現在接続されているスクリーンのリストを返します。 + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### スクリーン + +Go構造体: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript型定義: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index 869e1a22..d506cce7 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` ウィンドウの幅と高さを設定します。 -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowGetSize @@ -116,7 +116,7 @@ Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `Windo サイズを`0,0`に設定すると、サイズの制約が無効化されます。 -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize @@ -124,7 +124,7 @@ Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `Win サイズを`0,0`に設定すると、サイズの制約が無効化されます。 -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway 現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を設定します。 -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition @@ -200,6 +200,12 @@ Windowsの場合、0または255のアルファ値(A) のみがサポートさ Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## TypeScript型定義 ### Position diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index 5a669a61..55c52342 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/ja/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/ja/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx index e8963ce5..3cda7c1c 100644 --- a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## v2.6.0 - 2023-09-06 + +### Breaking Changes + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### Fixed -- Avoid app crashing when the Linux GTK key is empty by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### Added + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### Changed +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx index cf6cffdc..9f5523fc 100644 --- a/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-pages/community-guide.mdx @@ -102,41 +102,41 @@ Wailsはオープンソースであり、コミュニティ主導のプロジェ ご覧のウェブサイトは、プロジェクトのメインドキュメントサイトの役割も担っています。 しばしば、ドキュメントの内容は古くなっていることがあるため、多少の修正が必要になってきます。 また、内容がベストな品質となっていないドキュメントもいくつかあります。 ドキュメントを作成する作業は労力がかかるものであるため、これらへの貢献は大歓迎です。 ドキュメント化されていない機能はプロジェクトとしてまだ未完成である、と言っていいほど、ドキュメントはコードと同じくらい_重要なもの_です。 -We generally do not create tickets for updating documentation so if there is text you think should be updated or rephrased then feel free to submit a PR for that. This site is in the main repository under the `website` directory. We use [Docusaurus](https://docusaurus.io/) to create the site so there is plenty of existing documentation and tutorials around to get started. +通常、ドキュメントの更新に関するチケットは作成しませんので、もし更新や文言修正が必要なドキュメントが存在する場合は、気兼ねなくプルリクエストを作成してください。 このサイトは、メインリポジトリの`website`ディレクトリ内に格納されています。 サイト制作には[Docusaurus](https://docusaurus.io/)というツールを使用しており、このツールを使うためのドキュメントやチュートリアルはたくさん用意されています。 -To set up a local documentation development environment, do the following: +自身のローカル環境にドキュメント作成環境を構築するには、次の手順を実施してください: -- [Install npm](https://docs.npmjs.com/cli/v8/configuring-npm/install) +- [npmをインストール](https://docs.npmjs.com/cli/v8/configuring-npm/install) - `cd website` - `npm install` - `npm run start` -After it has all installed and is running, you should see the site at [`http://localhost:3000`](http://localhost:3000). Any changes made to the site text will be immediately reflected in the browser. +上記の手順をすべて実施後、[`http://localhost:3000`](http://localhost:3000)へアクセスすると、サイトが表示されるはずです。 サイト内のテキストに変更を加えると、すぐにブラウザに変更が反映されます。 #### バージョン管理 -We employ a versioning system where we have the "latest" documentation AKA "Next Version" which has all the changes that have occurred since the last release. We also keep the last release documentation as well as the version before that. +ドキュメントにはバージョン管理システムを使用しており、"最新(次期バージョン)" のドキュメントには、直近のリリース以降に発生したすべての更新内容が記載されています。 また、直近リリース分とその1つ前のリリース分のドキュメントを保持するようにしています。 -There isn't usually a reason to update released documentation so we don't generally update the documents in the `versioned_docs` or `versioned_sidebars` directories. +通常、リリース済みのドキュメントを更新する理由はないため、`versioned_docs`ディレクトリや`versioned_sidebars`ディレクトリは基本的に更新しません。 -The "next version" docs are mainly in `website/docs` with some "version independent" documents in `src/pages`. Any updates should be made in the `website/docs` directory. +"次期バージョン"のドキュメントは`website/docs`ディレクトリ、バージョンに依存しないドキュメントは`src/pages`ディレクトリに存在します。 すべての更新は`website/docs`ディレクトリで実施してください。 #### 翻訳 -The default documents of the Wails project are English documents. We use the "crowdin" tool to translate documents in other languages and synchronize them to the website. You can [join our project](https://crowdin.com/project/wails) and submit your translations to make contributions. +Wailsプロジェクトのデフォルトドキュメントは英語です。 私たちは、"crowdin"というツールを使用してドキュメントを様々な言語に翻訳し、Webサイトに同期させています。 翻訳に貢献していただける場合は、[私たちのcrowdinプロジェクトに参加](https://crowdin.com/project/wails)してください。 -##### Add new language +##### 新しい言語の追加 -If you want to add a new language to the documentation, please follow the prompts to [fill in and submit an Issue](https://github.com/wailsapp/wails/issues/new?assignees=&labels=documentation&template=documentation.yml). After being confirmed by the maintainer, we will add the language to the "crowdin" and you will then be able to submit your translation. +ドキュメントに新しい言語を追加したい場合は、プロンプトに従って[イシューを作成](https://github.com/wailsapp/wails/issues/new?assignees=&labels=documentation&template=documentation.yml)してください。 管理者が確認し次第、"crowdin"に言語が追加され、翻訳をはじめることができます。 -### Helping Others +### 他者を助ける -A great way to contribute to the project is to help others who are experiencing difficulty. This is normally reported as a ticket or a message on the Wails discord server. Even just clarifying the issue can really help out. Sometimes, when an issue is discussed and gets resolved, we create a guide out of it to help others who face the same issues. +困難に直面している他者を助けることは、プロジェクトにとって大きな貢献となります。 WailsのDiscordサーバでは、助けを求めている人が、チケットまたはメッセージを投稿しています。 曖昧な問題をより明確にしていただくだけでも、非常に助かります。 問題が議論されていき、最終的に解決されると、同じ問題に直面している人を助けるために、ガイドを作成する場合があります。 -To join the Wails discord server, click [here](https://discord.gg/JDdSxwjhGf). +WailsのDiscordサーバに参加するには、[こちら](https://discord.gg/JDdSxwjhGf)をクリックしてください。 :::note -Work In Progress +このドキュメントは書きかけの状態です。 ::: diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx index 5b57cd60..3e000705 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for - [wails-react-template](https://github.com/flin7/wails-react-template) - A minimal template for React that supports live development - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - A template using Next.js and TypeScript - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - A template for React + TypeScript + Vite + TailwindCSS +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - A template with Vite, React, TypeScript, TailwindCSS, and shadcn/ui ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - A template using Svelte - [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - A template using Svelte and Vite - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - A template using Svelte and Vite with TailwindCSS v3 +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit ## Solid diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/application-development.mdx index 0625ddb7..e4251eba 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ Wails v2 앱은 선택적으로 `options.App`에서 `http.Handler`를 정의할 ## External Dev Server -일부 프레임워크는 자체 라이브 리로딩 서버와 함께 제공되지만 Wails Go 바인딩을 활용할 수 없습니다. 이 시나리오에서는 Wails가 감시할 빌드 디렉토리에 프로젝트를 다시 빌드하는 watcher script를 실행하는 것이 가장 좋습니다. 예를 보려면 [rollup](https://rollupjs.org/guide/en/)을 사용하는 기본 svelte 템플릿을 참조하세요. [create-react-app](https://create-react-app.dev/)의 경우 다음을 사용할 수 있습니다. [this script](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd)를 사용하여 유사한 결과를 얻을 수 있습니다. +일부 프레임워크는 자체 라이브 리로딩 서버와 함께 제공되지만 Wails Go 바인딩을 활용할 수 없습니다. 이 시나리오에서는 Wails가 감시할 빌드 디렉토리에 프로젝트를 다시 빌드하는 watcher script를 실행하는 것이 가장 좋습니다. 예를 보려면 [rollup](https://rollupjs.org/guide/en/)을 사용하는 기본 svelte 템플릿을 참조하세요. + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Go Module diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index 12430131..28482ac3 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ If this does happen, simply delete `frontend/node_modules` and `frontend/package ## Build process stuck on "Generating bindings" Bindings generation process runs your application in a special mode. If application, intentionally or unintentionally, contains an endless loop (i.e. not exiting after `wails.Run()` finished), this can lead to build process stuck on the stage of bindings generation. Please make sure your code exits properly. + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/cli.mdx index 10e021f5..a4817110 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,7 +53,8 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for |:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | | -clean | Cleans the `build/bin` directory | | | -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | -| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | | +| -debug | Retains debug information in the application and shows the debug console. Allows the use of the devtools in the application window | | +| -devtools | Allows the use of the devtools in the application window in production (when -debug is not used) | | | -dryrun | Prints the build command without executing it | | | -f | Force build application | | | -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` | diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx index 451d7a94..e1bb970a 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,6 +362,33 @@ Indicates what value the `CSSDragProperty` style should have to drag the window. Name: CSSDragValue
Type: `string` +### EnableDefaultContextMenu + +EnableDefaultContextMenu enables the browser's default context-menu in production. + +By default, the browser's default context-menu is only available in development and in a `-debug` or `-devtools` [build](../reference/cli.mdx#build) along with the devtools inspector, Using this option you can enable the default context-menu in `production` while the devtools inspector won't be available unless the `-devtools` build flag is used. + +When this option is enabled, by default the context-menu will only be shown for text contexts (where Cut/Copy/Paste is needed), to override this behavior, you can use the CSS property `--default-contextmenu` on any HTML element (including the `body`) with the following values : + +| CSS Style | Behavior | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--default-contextmenu: auto;` | (**default**) will show the default context menu only if :
contentEditable is true OR text has been selected OR element is input or textarea | +| `--default-contextmenu: show;` | will always show the default context menu | +| `--default-contextmenu: hide;` | will always hide the default context menu | + +This rule is inherited like any normal CSS rule, so nesting works as expected. + +:::note +This filtering functionality is only enabled in production, so in development and in debug build, the full context-menu is always available everywhere. +::: + +:::warning +This filtering functionality is NOT a security measure, the developer should expect that the full context-menu could be leaked anytime which could contain commands like (Download image, Reload, Save webpage), if this is a concern, the developer SHOULD NOT enable the default context-menu. +::: + + +Name: EnableDefaultContextMenu
Type: `bool` + ### EnableFraudulentWebsiteDetection EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft. @@ -383,6 +413,12 @@ A slice of struct instances defining methods that need to be bound to the fronte Name: Bind
Type: `[]interface{}` +### ErrorFormatter + +A function that determines how errors are formatted when returned by a JS-to-Go method call. The returned value will be marshalled as JSON. + +Name: ErrorFormatter
Type: `func (error) any` + ### Windows This defines [Windows specific options](#windows). @@ -751,6 +787,14 @@ Name: WebviewGpuPolicy
Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy | WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents | | WebviewGpuPolicyNever | Hardware acceleration is always disabled | +#### ProgramName + +This option is used to set the program's name for the window manager via GTK's g_set_prgname(). This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html). + +When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name` property differs form the executable's filename. + +Name: ProgramName
Type: string
+ ### Debug This defines [Debug specific options](#Debug) that apply to debug builds. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 5c7d578b..8e763502 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -6,7 +6,7 @@ sidebar_position: 5 The project config resides in the `wails.json` file in the project directory. The structure of the config is: -```json +```json5 { // Project config version "version": "", diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..457c92eb --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# Screen + +These methods provide information about the currently connected screens. + +### ScreenGetAll + +Returns a list of currently connected screens. + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### Screen + +Go struct: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript interface: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index 07aa654f..8e105228 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` 창의 너비와 높이를 설정합니다. -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowGetSize @@ -116,7 +116,7 @@ Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `Windo `0,0`의 크기를 설정하면 이 제약 조건이 비활성화됩니다. -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize @@ -124,7 +124,7 @@ Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `Win `0,0`의 크기를 설정하면 이 제약 조건이 비활성화됩니다. -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway 창이 현재 켜져 있는 모니터를 기준으로 창 위치를 설정합니다. -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition @@ -200,6 +200,12 @@ Windows에서는 0 또는 255의 알파 값만 지원됩니다. 0이 아닌 모 Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## TypeScript Object Definitions ### 위치 diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index 8eceef48..4bc3bcaa 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx index 0bc23b16..1af17f00 100644 --- a/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## v2.6.0 - 2023-09-06 + +### Breaking Changes + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### Fixed -- Avoid app crashing when the Linux GTK key is empty by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### Added + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### Changed +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx index 00d82e74..a019ec07 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ Se você não tiver certeza sobre um template, inspecione `package.json` e `wail - [wails-react-template](https://github.com/flin7/wails-react-template) - A minimal template for React that supports live development - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - A template using Next.js and TypeScript - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - A template for React + TypeScript + Vite + TailwindCSS +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - A template with Vite, React, TypeScript, TailwindCSS, and shadcn/ui ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - A template using Svelte - [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - A template using Svelte and Vite - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - A template using Svelte and Vite with TailwindCSS v3 +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit ## Solid diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/application-development.mdx index d03f38f8..0d78b9d9 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ O servidor de desenvolvimento utiliza uma técnica chamada "debwaring" que signi ## Servidor de Desenvolvedor Externo -Alguns frameworks vêm com seu próprio servidor ao vivo, no entanto, eles não serão capazes de tirar proveito das ligações Go/Wails. Neste cenário, é melhor executar um script de observador que reconstrui o projeto no diretório build, que Wails estará assistindo. Por exemplo, veja o modelo padrão do svelte que usa [rollup](https://rollupjs.org/guide/en/). Para [create-react-app](https://create-react-app.dev/), é possível usar [este script](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd) para alcançar um resultado similar. +Alguns frameworks vêm com seu próprio servidor ao vivo, no entanto, eles não serão capazes de tirar proveito das ligações Go/Wails. Neste cenário, é melhor executar um script de observador que reconstrui o projeto no diretório build, que Wails estará assistindo. Por exemplo, veja o modelo padrão do svelte que usa [rollup](https://rollupjs.org/guide/en/). + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Go Module diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index e5539f2e..5b319f9a 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ If this does happen, simply delete `frontend/node_modules` and `frontend/package ## Build process stuck on "Generating bindings" Bindings generation process runs your application in a special mode. If application, intentionally or unintentionally, contains an endless loop (i.e. not exiting after `wails.Run()` finished), this can lead to build process stuck on the stage of bindings generation. Please make sure your code exits properly. + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/cli.mdx index f1fe9aeb..6d22b657 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,7 +53,8 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for |:-------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------- | | -clean | Limpa o diretório `compilação/bin` | | | -compiler "compiler" | Use um compilador de ida diferente para realizar build, por exemplo, go1.15beta1 | go | -| -debug | Mantém as informações de depuração no aplicativo. Permite o uso das ferramentas devtools na janela do aplicativo | | +| -debug | Retains debug information in the application and shows the debug console. Permite o uso das ferramentas devtools na janela do aplicativo | | +| -devtools | Allows the use of the devtools in the application window in production (when -debug is not used) | | | -dryrun | Prints the build command without executing it | | | -f | Forçar compilação de aplicação | | | -garbleargs | Argumentos para passar para o garble | `-literals -tiny -seed=random` | diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx index 451d7a94..e1bb970a 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,6 +362,33 @@ Indicates what value the `CSSDragProperty` style should have to drag the window. Name: CSSDragValue
Type: `string` +### EnableDefaultContextMenu + +EnableDefaultContextMenu enables the browser's default context-menu in production. + +By default, the browser's default context-menu is only available in development and in a `-debug` or `-devtools` [build](../reference/cli.mdx#build) along with the devtools inspector, Using this option you can enable the default context-menu in `production` while the devtools inspector won't be available unless the `-devtools` build flag is used. + +When this option is enabled, by default the context-menu will only be shown for text contexts (where Cut/Copy/Paste is needed), to override this behavior, you can use the CSS property `--default-contextmenu` on any HTML element (including the `body`) with the following values : + +| CSS Style | Behavior | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--default-contextmenu: auto;` | (**default**) will show the default context menu only if :
contentEditable is true OR text has been selected OR element is input or textarea | +| `--default-contextmenu: show;` | will always show the default context menu | +| `--default-contextmenu: hide;` | will always hide the default context menu | + +This rule is inherited like any normal CSS rule, so nesting works as expected. + +:::note +This filtering functionality is only enabled in production, so in development and in debug build, the full context-menu is always available everywhere. +::: + +:::warning +This filtering functionality is NOT a security measure, the developer should expect that the full context-menu could be leaked anytime which could contain commands like (Download image, Reload, Save webpage), if this is a concern, the developer SHOULD NOT enable the default context-menu. +::: + + +Name: EnableDefaultContextMenu
Type: `bool` + ### EnableFraudulentWebsiteDetection EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft. @@ -383,6 +413,12 @@ A slice of struct instances defining methods that need to be bound to the fronte Name: Bind
Type: `[]interface{}` +### ErrorFormatter + +A function that determines how errors are formatted when returned by a JS-to-Go method call. The returned value will be marshalled as JSON. + +Name: ErrorFormatter
Type: `func (error) any` + ### Windows This defines [Windows specific options](#windows). @@ -751,6 +787,14 @@ Name: WebviewGpuPolicy
Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy | WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents | | WebviewGpuPolicyNever | Hardware acceleration is always disabled | +#### ProgramName + +This option is used to set the program's name for the window manager via GTK's g_set_prgname(). This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html). + +When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name` property differs form the executable's filename. + +Name: ProgramName
Type: string
+ ### Debug This defines [Debug specific options](#Debug) that apply to debug builds. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 5c7d578b..8e763502 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -6,7 +6,7 @@ sidebar_position: 5 The project config resides in the `wails.json` file in the project directory. The structure of the config is: -```json +```json5 { // Project config version "version": "", diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..457c92eb --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# Screen + +These methods provide information about the currently connected screens. + +### ScreenGetAll + +Returns a list of currently connected screens. + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### Screen + +Go struct: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript interface: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index d834e765..04cc08ea 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` Define a largura e a altura da janela. -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowGetSize @@ -116,7 +116,7 @@ Define o tamanho mínimo da janela. Será redimensionada a janela se a janela fo Definir um tamanho de `0,0` irá desativar esta restrição. -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize @@ -124,7 +124,7 @@ Define o tamanho máximo da janela. Será redimensionada a janela se a janela fo Definir um tamanho de `0,0` irá desativar esta restrição. -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway Define a posição da janela em relação ao monitor da janela ativada. -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition @@ -200,6 +200,12 @@ No Windows, apenas valores alfa de 0 ou 255 são suportados. Qualquer valor que Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## TypeScript Object Definitions ### Position diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index b783461d..ea350890 100644 --- a/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx index c12395f4..ac2ac18b 100644 --- a/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c ## [Unreleased] +## v2.6.0 - 2023-09-06 + +### Grandes Alterações + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### Corrigido -- Avoid app crashing when the Linux GTK key is empty by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### Adicionado + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### Alterado +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx index 74b7673f..6dd14b91 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ sidebar_position: 1 - [wails-react-template](https://github.com/flin7/wails-react-template) - минимальный шаблон для React, который поддерживает живую разработку - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - шаблон с использованием Next.js и TypeScript - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - шаблон для React + TypeScript + Vite + TailwindCSS +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - A template with Vite, React, TypeScript, TailwindCSS, and shadcn/ui ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - шаблон с использованием Svelte - [wails-vite-template](https://github.com/BillBuilt/wails-vite-svelte-template) - шаблон с использованием Svelte и Vite - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - шаблон с использованием Svelte и Vite с TailwindCSS v3 +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - шаблон с использованием SvelteKit ## Solid diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/application-development.mdx index 00c77ef5..f9e723fe 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ The dev server uses a technique called "debouncing" which means it doesn't reloa ## External Dev Server -Some frameworks come with their own live-reloading server, however they will not be able to take advantage of the Wails Go bindings. In this scenario, it is best to run a watcher script that rebuilds the project into the build directory, which Wails will be watching. For an example, see the default svelte template that uses [rollup](https://rollupjs.org/guide/en/). For [create-react-app](https://create-react-app.dev/), it's possible to use [this script](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd) to achieve a similar result. +Some frameworks come with their own live-reloading server, however they will not be able to take advantage of the Wails Go bindings. In this scenario, it is best to run a watcher script that rebuilds the project into the build directory, which Wails will be watching. For an example, see the default svelte template that uses [rollup](https://rollupjs.org/guide/en/). + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Go Module diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index e5539f2e..5b319f9a 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ If this does happen, simply delete `frontend/node_modules` and `frontend/package ## Build process stuck on "Generating bindings" Bindings generation process runs your application in a special mode. If application, intentionally or unintentionally, contains an endless loop (i.e. not exiting after `wails.Run()` finished), this can lead to build process stuck on the stage of bindings generation. Please make sure your code exits properly. + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx index 10e021f5..a4817110 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,7 +53,8 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for |:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | | -clean | Cleans the `build/bin` directory | | | -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | -| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | | +| -debug | Retains debug information in the application and shows the debug console. Allows the use of the devtools in the application window | | +| -devtools | Allows the use of the devtools in the application window in production (when -debug is not used) | | | -dryrun | Prints the build command without executing it | | | -f | Force build application | | | -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` | diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx index 451d7a94..e1bb970a 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,6 +362,33 @@ Indicates what value the `CSSDragProperty` style should have to drag the window. Name: CSSDragValue
Type: `string` +### EnableDefaultContextMenu + +EnableDefaultContextMenu enables the browser's default context-menu in production. + +By default, the browser's default context-menu is only available in development and in a `-debug` or `-devtools` [build](../reference/cli.mdx#build) along with the devtools inspector, Using this option you can enable the default context-menu in `production` while the devtools inspector won't be available unless the `-devtools` build flag is used. + +When this option is enabled, by default the context-menu will only be shown for text contexts (where Cut/Copy/Paste is needed), to override this behavior, you can use the CSS property `--default-contextmenu` on any HTML element (including the `body`) with the following values : + +| CSS Style | Behavior | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--default-contextmenu: auto;` | (**default**) will show the default context menu only if :
contentEditable is true OR text has been selected OR element is input or textarea | +| `--default-contextmenu: show;` | will always show the default context menu | +| `--default-contextmenu: hide;` | will always hide the default context menu | + +This rule is inherited like any normal CSS rule, so nesting works as expected. + +:::note +This filtering functionality is only enabled in production, so in development and in debug build, the full context-menu is always available everywhere. +::: + +:::warning +This filtering functionality is NOT a security measure, the developer should expect that the full context-menu could be leaked anytime which could contain commands like (Download image, Reload, Save webpage), if this is a concern, the developer SHOULD NOT enable the default context-menu. +::: + + +Name: EnableDefaultContextMenu
Type: `bool` + ### EnableFraudulentWebsiteDetection EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft. @@ -383,6 +413,12 @@ A slice of struct instances defining methods that need to be bound to the fronte Name: Bind
Type: `[]interface{}` +### ErrorFormatter + +A function that determines how errors are formatted when returned by a JS-to-Go method call. The returned value will be marshalled as JSON. + +Name: ErrorFormatter
Type: `func (error) any` + ### Windows This defines [Windows specific options](#windows). @@ -751,6 +787,14 @@ Name: WebviewGpuPolicy
Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy | WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents | | WebviewGpuPolicyNever | Hardware acceleration is always disabled | +#### ProgramName + +This option is used to set the program's name for the window manager via GTK's g_set_prgname(). This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html). + +When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name` property differs form the executable's filename. + +Name: ProgramName
Type: string
+ ### Debug This defines [Debug specific options](#Debug) that apply to debug builds. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 5c7d578b..8e763502 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -6,7 +6,7 @@ sidebar_position: 5 The project config resides in the `wails.json` file in the project directory. The structure of the config is: -```json +```json5 { // Project config version "version": "", diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..457c92eb --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# Screen + +These methods provide information about the currently connected screens. + +### ScreenGetAll + +Returns a list of currently connected screens. + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### Screen + +Go struct: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript interface: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index f27d2fe1..15f555c5 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` Sets the width and height of the window. -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowGetSize @@ -116,7 +116,7 @@ Sets the minimum window size. Will resize the window if the window is currently Setting a size of `0,0` will disable this constraint. -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize @@ -124,7 +124,7 @@ Sets the maximum window size. Will resize the window if the window is currently Setting a size of `0,0` will disable this constraint. -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway Sets the window position relative to the monitor the window is currently on. -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition @@ -200,6 +200,12 @@ On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## TypeScript Object Definitions ### Position diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index 2be6d845..77d128b1 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx index e8963ce5..3cda7c1c 100644 --- a/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## v2.6.0 - 2023-09-06 + +### Breaking Changes + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### Fixed -- Avoid app crashing when the Linux GTK key is empty by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### Added + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### Changed +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx index be09b3de..b2dd2b37 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -40,12 +40,14 @@ sidebar_position: 1 - [wails-react-template](https://github.com/flin7/wails-react-template) - 基于 React 并支持实时开发模式的轻量级模板 - [wails-vite-react-ts](https://github.com/lontten/wails-vite-react-ts) - 基于 Vite + React + TypeScript 的模板 - [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - 一个 React + TypeScript + Vite + TailwindCSS 模板 +- [wails-vite-react-ts-tailwind-shadcnui-template](https://github.com/Mahcks/wails-vite-react-tailwind-shadcnui-ts) - A template with Vite, React, TypeScript, TailwindCSS, and shadcn/ui ## Svelte - [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - 基于 Svelte 的模板 - [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - 使用 Svelte 和 Vite 的模板 - [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - 使用 Svelte 和 Vite 和 TailwindCSS v3 的模板 +- [wails-svelte-tailwind-vite-template](https://github.com/PylotLight/wails-vite-svelte-tailwind-template/tree/master) - An updated template using Svelte v4.2.0 and Vite with TailwindCSS v3.3.3 - [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - 基于 Next.js + TypeScript 的模板 ## Solid diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/application-development.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/application-development.mdx index df6ef37d..27217a9a 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/application-development.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -187,7 +187,28 @@ Wails v2 应用程序可以选择在 `options.App` 中定义一个 `http.Handler ## 外部开发服务器 -一些框架带有自己的实时重新加载服务器,但是它们将无法利用 Wails Go 绑定。 在这种情况下,最好运行一个监听脚本,将项目重新构建到构建目录中,Wails 将监视该目录。 有关示例,请参阅使用 [rollup](https://rollupjs.org/guide/en/) 的默认 svelte 模板。 对于 [create-react-app](https://create-react-app.dev/),可以使用 [此脚本](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd) 来实现类似的结果。 +一些框架带有自己的实时重新加载服务器,但是它们将无法利用 Wails Go 绑定。 在这种情况下,最好运行一个监听脚本,将项目重新构建到构建目录中,Wails 将监视该目录。 有关示例,请参阅使用 [rollup](https://rollupjs.org/guide/en/) 的默认 svelte 模板。 + +### Create React App + +The process for a Create-React-App project is slightly more complicated. In order to support live frontend reloading the following configuration needs to be added to your `wails.json`: + +```json + "frontend:dev:watcher": "yarn start", + "frontend:dev:serverUrl": "http://localhost:3000", +``` + +The `frontend:dev:watcher` command will start the Create-React-App development server (hosted on port `3000` typically). The `frontend:dev:serverUrl` command then instructs Wails to serve assets from the development server when loading the frontend rather than from the build folder. In addition to the above, the `index.html` needs to be updated with the following: + +```html + + + + + +``` + +This is required as the watcher command that rebuilds the frontend prevents Wails from injecting the required scripts. This circumvents that issue by ensuring the scripts are always injected. With this configuration, `wails dev` can be run which will appropriately build the frontend and backend with hot-reloading enabled. Additionally, when accessing the application from a browser the React developer tools can now be used on a non-minified version of the application for straightforward debugging. Finally, for faster builds, `wails dev -s` can be run to skip the default building of the frontend by Wails as this is an unnecessary step. ## Go 模块 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx new file mode 100644 index 00000000..4651c422 --- /dev/null +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/sveltekit.mdx @@ -0,0 +1,153 @@ +# SvelteKit + +This guide will go into: + +1. Miminal Installation Steps - The steps needed to get a minimum Wails setup working for SvelteKit. +2. Install Script - Bash script for accomplishing the Minimal Installation Steps with optional Wails branding. +3. Important Notes - Issues that can be encountered when using SvelteKit + Wails and fixes. + +## 1. Minimal Installation Steps + +##### Install Wails for Svelte. + +- `wails init -n myapp -t svelte` + +##### Delete the svelte frontend. + +- Navigate into your newly created myapp folder. +- Delete the folder named "frontend" + +##### While in the Wails project root. Use your favorite package manager and install SvelteKit as the new frontend. Follow the prompts. + +- `npm create svelte@latest frontend` + +##### Modify wails.json. + +- Add `"wailsjsdir": "./frontend/src/lib",` Do note that this is where your Go and runtime functions will appear. +- Change your package manager frontend here if not using npm. + +##### Modify main.go. + +- The first comment `//go:embed all:frontend/dist` needs to be changed to `//go:embed all:frontend/build` + +##### Install/remove dependencies using your favorite package manager. + +- Navigate into your "frontend" folder. +- `npm i` +- `npm uninstall @sveltejs/adapter-auto` +- `npm i -D @sveltejs/adapter-static` + +##### Change adapter in svelte.config.js + +- First line of file change `import adapter from '@sveltejs/adapter-auto';` to `import adapter from '@sveltejs/adapter-static';` + +##### Put SvelteKit into SPA mode with prerendering. + +- Create a file under myapp/frontend/src/routes/ named +layout.ts/+layout.js. +- Add two lines into the newly created file `export const prerender = true` and `export const ssr = false` + +##### Test installation. + +- Navigate back into the Wails project root (one directory up). +- run `wails dev` +- If the application doesn't run please check through the previous steps. + +## 2. Install Script + +##### This Bash Script does the steps listed above. Make sure to read over the script and understand what the script is doing on your computer. + +- Create a file sveltekit-wails.sh +- Copy the below code into the new file then save it. +- Make it executable with `chmod +x sveltekit-wails.sh` +- Brand is an optional param below that adds back in the wails branding. Leave third param blank to not insert the Wails branding. +- Example usage: `./sveltekit-wails.sh pnpm newapp brand` + +##### sveltekit-wails.sh: + +``` +manager=$1 +project=$2 +brand=$3 +wails init -n $project -t svelte +cd $project +sed -i "s|npm|$manager|g" wails.json +sed -i 's|"auto",|"auto",\n "wailsjsdir": "./frontend/src/lib",|' wails.json +sed -i "s|all:frontend/dist|all:frontend/build|" main.go +if [[ -n $brand ]]; then + mv frontend/src/App.svelte +page.svelte + sed -i "s|'./assets|'\$lib/assets|" +page.svelte + sed -i "s|'../wails|'\$lib/wails|" +page.svelte + mv frontend/src/assets . +fi +rm -r frontend +$manager create svelte@latest frontend +if [[ -n $brand ]]; then + mv +page.svelte frontend/src/routes/+page.svelte + mkdir frontend/src/lib + mv assets frontend/src/lib/ +fi +cd frontend +$manager i +$manager uninstall @sveltejs/adapter-auto +$manager i -D @sveltejs/adapter-static +echo -e "export const prerender = true\nexport const ssr = false" > src/routes/+layout.ts +sed -i "s|-auto';|-static';|" svelte.config.js +cd .. +wails dev +``` + +## 3. Important Notes + +##### Server files will cause build failures. + +- \+layout.server.ts, +page.server.ts, +server.ts or any file with "server" in the name will fail to build as all routes are prerendered. + +##### The Wails runtime unloads with full page navigations! + +- Anything that causes full page navigations: `window.location.href = '//'` or Context menu reload when using wails dev. What this means is that you can end up losing the ability to call any runtime breaking the app. There are two ways to work around this. +- Use `import { goto } from '$app/navigation'` then call `goto('//')` in your +page.svelte. This will prevent a full page navigation. +- If full page navigation can't be prevented the Wails runtime can be added to all pages by adding the below into the `` of myapp/frontend/src/app.html + +``` + +... + + + +... + +``` + +See https://wails.io/docs/guides/frontend for more information. + +##### Inital data can be loaded and refreshed from +page.ts/+page.js to +page.svelte. + +- \+page.ts/+page.js works well with load() https://kit.svelte.dev/docs/load#page-data +- invalidateAll() in +page.svelte will call load() from +page.ts/+page.js https://kit.svelte.dev/docs/load#rerunning-load-functions-manual-invalidation. + +##### Error Handling + +- Expected errors using Throw error works in +page.ts/+page.js with a +error.svelte page. https://kit.svelte.dev/docs/errors#expected-errors +- Unexpected errors will cause the application to become unusable. Only recovery option (known so far) from unexpected errors is to reload the app. To do this create a file myapp/frontend/src/hooks.client.ts then add the below code to the file. + +``` +import { WindowReloadApp } from '$lib/wailsjs/runtime/runtime' +export async function handleError() { + WindowReloadApp() +} +``` + +##### Using Forms and handling functions + +- The simplest way is to call a function from the form is the standard, bind:value your variables and prevent submission `` +- The more advanced way is to use:enhance (progressive enhancement) which will allow for convenient access to formData, formElement, submitter. The important note is to always cancel() the form which prevents server side behavior. https://kit.svelte.dev/docs/form-actions#progressive-enhancement Example: + +``` + { + cancel() + console.log(Object.fromEntries(formData)) + console.log(formElement) + console.log(submitter) + handle() +}}> +``` diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx index 2e066a4a..0bf892ed 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -170,3 +170,19 @@ In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/Sy ## 构建过程停留在“生成绑定” 绑定生成过程在特殊模式下运行应用程序。 如果应用程序有意或无意地包含一个无限循环(即在 `wails.Run()` 结束后不退出),这可能导致构建过程停留在绑定生成阶段。 请确保您的代码正确退出。 + +## Mac application flashes white at startup + +This is due to the default background of the webview being white. If you want to use the window background colour instead, you can make the webview background transparent using the following config: + +```go + err := wails.Run(&options.App{ + Title: "macflash", + Width: 1024, + Height: 768, + // Other settings + Mac: &mac.Options{ + WebviewIsTransparent: true, + }, + }) +``` \ No newline at end of file diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli.mdx index d6d3720a..b157a1bb 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -53,7 +53,8 @@ Wails CLI 有许多用于管理项目的命令。 所有命令都以此方式运 |:--------------- |:------------------------------------------------------------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------- | | -clean | 清理 `build/bin` 目录 | | | -compiler "编译器" | 使用不同的 go 编译器来构建,例如 go1.15beta1 | go | -| -debug | 在应用程序中保留调试信息。 允许在应用程序窗口中使用 devtools | | +| -debug | Retains debug information in the application and shows the debug console. 允许在应用程序窗口中使用 devtools | | +| -devtools | Allows the use of the devtools in the application window in production (when -debug is not used) | | | -dryrun | 打印构建命令但不执行它 | | | -f | 强制构建应用 | | | -garbleargs | 传递给 garble 的参数 | `-literals -tiny -seed=random` | diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx index 69f6b9f6..0c43e683 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -50,12 +50,14 @@ func main() { OnBeforeClose: app.beforeClose, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", + EnableDefaultContextMenu: false, EnableFraudulentWebsiteDetection: false, ZoomFactor: 1.0, IsZoomControlEnabled: false, Bind: []interface{}{ app, }, + ErrorFormatter: func(err error) any { return err.Error() }, Windows: &windows.Options{ WebviewIsTransparent: false, WindowIsTranslucent: false, @@ -103,6 +105,7 @@ func main() { Icon: icon, WindowIsTranslucent: false, WebviewGpuPolicy: linux.WebviewGpuPolicyAlways, + ProgramName: "wails" }, Debug: options.Debug{ OpenInspectorOnStartup: false, @@ -359,6 +362,33 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { 名称:CSSDragValue
类型:`string` +### EnableDefaultContextMenu + +EnableDefaultContextMenu enables the browser's default context-menu in production. + +By default, the browser's default context-menu is only available in development and in a `-debug` or `-devtools` [build](../reference/cli.mdx#build) along with the devtools inspector, Using this option you can enable the default context-menu in `production` while the devtools inspector won't be available unless the `-devtools` build flag is used. + +When this option is enabled, by default the context-menu will only be shown for text contexts (where Cut/Copy/Paste is needed), to override this behavior, you can use the CSS property `--default-contextmenu` on any HTML element (including the `body`) with the following values : + +| CSS Style | Behavior | +| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--default-contextmenu: auto;` | (**default**) will show the default context menu only if :
contentEditable is true OR text has been selected OR element is input or textarea | +| `--default-contextmenu: show;` | will always show the default context menu | +| `--default-contextmenu: hide;` | will always hide the default context menu | + +This rule is inherited like any normal CSS rule, so nesting works as expected. + +:::note +This filtering functionality is only enabled in production, so in development and in debug build, the full context-menu is always available everywhere. +::: + +:::warning +This filtering functionality is NOT a security measure, the developer should expect that the full context-menu could be leaked anytime which could contain commands like (Download image, Reload, Save webpage), if this is a concern, the developer SHOULD NOT enable the default context-menu. +::: + + +Name: EnableDefaultContextMenu
Type: `bool` + ### 启用欺诈网站检测 EnableFraudulentWebsiteDetection 启用针对欺诈内容(例如恶意软件或网络钓鱼尝试)的扫描服务。 这些服务可能会从你的应用中发送信息,比如导航到苹果和微软的云服务的url和其他内容。 @@ -383,6 +413,12 @@ EnableFraudulentWebsiteDetection 启用针对欺诈内容(例如恶意软件 名称:Bind
类型:`[]interface{}` +### ErrorFormatter + +A function that determines how errors are formatted when returned by a JS-to-Go method call. The returned value will be marshalled as JSON. + +Name: ErrorFormatter
Type: `func (error) any` + ### Windows 这定义了 [Windows 特定的选项](#windows)。 @@ -767,6 +803,14 @@ func main() { | WebviewGpuPolicyOnDemand | 根据 Web 内容的请求启用/禁用硬件加速 | | WebviewGpuPolicyNever | 硬件加速始终处于禁用状态 | +#### ProgramName + +This option is used to set the program's name for the window manager via GTK's g_set_prgname(). This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html). + +When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name` property differs form the executable's filename. + +Name: ProgramName
Type: string
+ ### 调试 这定义了用于调试构建的 [调试特定选项](#调试)。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx index 9f7efc74..dc2a96b8 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -6,7 +6,7 @@ sidebar_position: 5 项目配置在项目目录中的 `wails.json` 文件中。 配置的结构是: -```json +```json5 { // 项目配置版本 "version": "", diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx new file mode 100644 index 00000000..457c92eb --- /dev/null +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/screen.mdx @@ -0,0 +1,38 @@ +--- +sidebar_position: 9 +--- + +# Screen + +These methods provide information about the currently connected screens. + +### ScreenGetAll + +Returns a list of currently connected screens. + +Go: `ScreenGetAll(ctx context.Context) []screen`
+JS: `ScreenGetAll()` + +#### Screen + +Go struct: + +```go +type Screen struct { + IsCurrent bool + IsPrimary bool + Width int + Height int +} +``` + +Typescript interface: + +```ts +interface Screen { + isCurrent: boolean; + isPrimary: boolean; + width : number + height : number +} +``` diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx index 3c767525..f5397d84 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -102,7 +102,7 @@ Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` 设置窗口的宽度和高度。 -Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(width: number, height: number)` ### WindowSetSize 获取窗口尺寸 @@ -116,7 +116,7 @@ Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `Windo 设置大小 `0,0` 将禁用此约束。 -Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(width: number, height: number)` ### WindowSetMaxSize 设置窗口最大尺寸 @@ -124,7 +124,7 @@ Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `Win 设置大小 `0,0` 将禁用此约束。 -Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(width: number, height: number)` ### WindowSetAlwaysOnTop 设置窗口置顶 @@ -136,7 +136,7 @@ Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlway 设置相对于窗口当前所在监视器的窗口位置。 -Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(position: Position)` +Go: `WindowSetPosition(ctx context.Context, x int, y int)`
JS: `WindowSetPosition(x: number, y: number)` ### WindowGetPosition 获取窗口位置 @@ -200,6 +200,12 @@ R、G、B 和 A 的有效值为 0-255。 Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` +### WindowPrint + +Opens tha native print dialog. + +Go: `WindowPrint(ctx context.Context)`
JS: `WindowPrint()` + ## TypeScript 对象定义 ### Position(位置) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx index af3110e7..863f7ac8 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -69,6 +69,7 @@ App Type: desktop Platforms: windows/amd64 Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe Build Mode: Production +Devtools: false Skip Frontend: false Compress: false Package: true diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0.json b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0.json new file mode 100644 index 00000000..a75900f4 --- /dev/null +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-v2.6.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.6.0", + "description": "The label for version v2.6.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Getting Started", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Reference", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Runtime", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Community", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Showcase", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guides", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contributing", + "description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing" + } +} diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx index bb874869..57ff12d0 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx @@ -13,13 +13,44 @@ ## [即将发布] +## v2.6.0 - 2023-09-06 + +### 重大变更 + +- AssetServer RequestURI and URL are now RFC and Go Docs compliant for server requests. This means Scheme, Host and Fragments are not provided anymore. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2722) + ### 修复 -- 当 Linux GTK 密钥为空时避免应用程序崩溃。 由 @aminya 在这个 [PR](https://github.com/wailsapp/wails/pull/2672) 中修复。 +- Avoid app crashing when the Linux GTK key is empty. Fixed by @aminya in [PR](https://github.com/wailsapp/wails/pull/2672) +- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841) +- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850) +- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853) +- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863) +- Fixed build hook command parsing. Added by @smac89 in [PR](https://github.com/wailsapp/wails/pull/2836) +- Fixed `-reloaddir` flag to watch additional directories (non-recursively). [@haukened](https://github.com/haukened) in [PR #2871](https://github.com/wailsapp/wails/pull/2871) +- Fixed support for Go 1.21 `go.mod` files. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2876) + +### 新增 + +- Added correct NodeJS and Docker package names for DNF package manager of Fedora 38. Added by @aranggitoar in [PR](https://github.com/wailsapp/wails/pull/2790) +- Added `-devtools` production build flag. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2725) +- Added `EnableDefaultContextMenu` option to allow enabling the browser's default context-menu in production . Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2733) +- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748) +- Added custom error formatting to allow passing structured errors back to the frontend. +- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771) +- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817) +- Added new community template wails-sveltekit-ts. Added by [@haukened](https://github.com/haukened) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for retrieving the logical and physical screen size in the screen api. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2856) +- Added new community template wails-sveltekit-tailwind. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2851) +- Added support for print dialogs. Added by [@aangelisc](https://github.com/aangelisc) in [PR](https://github.com/wailsapp/wails/pull/2822) +- Added new `wails dev -nogorebuild` flag to prevent restarts on back end file changes. [@haukened](https://github.com/haukened) in [PR #2870](https://github.com/wailsapp/wails/pull/2870) ### 变更 -- 更改了 `doctor` 命令的样式。 由 @MarvinJWendt 在 [PR](https://github.com/wailsapp/wails/pull/2660) 中更改。 +- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). +- Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) +- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) +- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745) ## v2.5.1 - 2023-05-16 @@ -30,9 +61,9 @@ ### 修复 -- 修复了在 macOS 上快速重新加载请求期间的分段错误。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2664) 中修复 -- 修复了 Linux 上旧 WebKit2GTK 版本小于 2.36 的开发服务器。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2664) 中修复 -- 修复了 Windows 上可能触发 WebView2 挂起的 devserver。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2664) 中修复 +- 修复了在 macOS 上快速重新加载请求期间的分段错误。 Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2664) +- 修复了 Linux 上旧 WebKit2GTK 版本小于 2.36 的开发服务器。 Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2664) +- 修复了 Windows 上可能触发 WebView2 挂起的 devserver。 Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2664) ## v2.5.0 - 2023-05-13 @@ -44,10 +75,10 @@ - 在 `wails doctor` 中添加了 Nodejs 版本。 由 @misitebao 在这个 [PR](https://github.com/wailsapp/wails/pull/2546) 中添加。 - 在 Linux 上添加了对 WebKit2GTK 2.40+ 的支持。 这为 [AssetServer](/docs/reference/options#资产服务器) 带来了额外的特性,比如对 HTTP 请求体的支持。 应用程序必须使用 Go 构建标签 `webkit2_40` 进行编译,以激活对此功能的支持。 这也会将您应用程序的 WebKit2GTK 最低要求提高到 2.40。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2592) 中添加。 -- macOS:添加了具有众所周知的快捷键“Minimize、Full-Screen 和 Zoom(最小化、全屏和缩放)”的窗口菜单角色。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2586) 中添加。 -- macOS:在 appmenu 中添加了“Hide、Hide Others、Show All(隐藏、隐藏其他、显示所有)”。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2586) 中添加。 -- Windows:添加了禁用 WebView2 `RendererCodeIntegrity` 检查的标志,请参阅标志上的注释以获取更多信息。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2627) 中添加。 -- Windows:添加了对 WebView2 进程崩溃的处理,对于不可恢复的错误,会显示一条错误消息,提示应用需要重新启动。 如果发生显示 chromium 错误页面的错误,请确保 Window 和 WebView2 可见。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2627) 中添加。 +- macOS:添加了具有众所周知的快捷键“Minimize、Full-Screen 和 Zoom(最小化、全屏和缩放)”的窗口菜单角色。 Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2586) +- macOS:在 appmenu 中添加了“Hide、Hide Others、Show All(隐藏、隐藏其他、显示所有)”。 Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2586) +- Windows:添加了禁用 WebView2 `RendererCodeIntegrity` 检查的标志,请参阅标志上的注释以获取更多信息。 Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2627) +- Windows:添加了对 WebView2 进程崩溃的处理,对于不可恢复的错误,会显示一条错误消息,提示应用需要重新启动。 如果发生显示 chromium 错误页面的错误,请确保 Window 和 WebView2 可见。 Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2627) ### 变更