diff --git a/website/docs/reference/options.mdx b/website/docs/reference/options.mdx index 19b6fdfe..13426d00 100644 --- a/website/docs/reference/options.mdx +++ b/website/docs/reference/options.mdx @@ -26,6 +26,7 @@ func main() { Height: 600, DisableResize: false, Fullscreen: false, + WindowStartState: options.Maximised, Frameless: true, MinWidth: 400, MinHeight: 400, @@ -48,7 +49,6 @@ func main() { OnDomReady: app.domready, OnShutdown: app.shutdown, OnBeforeClose: app.beforeClose, - WindowStartState: options.Maximised, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", ZoomFactor: 1.0, @@ -106,6 +106,7 @@ func main() { OpenInspectorOnStartup: false, }, }) + if err != nil { log.Fatal(err) } @@ -145,10 +146,20 @@ Type: `bool` ### Fullscreen -Setting this to `true` will make the window fullscreen at startup. +Deprecated: Please use [WindowStartState](#windowstartstate). -Name: Fullscreen
-Type: `bool` +### WindowStartState + +Defines how the window should present itself at startup. + +| Value | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +Name: WindowStartState
+Type: `options.WindowStartState` ### Frameless @@ -262,9 +273,9 @@ Type: `*assetserver.Options` #### Assets -The static frontend assets to be used by the application. +The static frontend assets to be used by the application. -A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, +A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. If set to nil, all GET requests will be forwarded to [Handler](#handler). @@ -278,9 +289,9 @@ The assets handler is a generic `http.Handler` for fallback handling of assets t The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. - If not defined, the result is the following in cases where the Handler would have been called: -- GET request: `http.StatusNotFound` + +- GET request: `http.StatusNotFound` - Other request: `http.StatusMethodNotAllowed` NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html @@ -388,19 +399,6 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { Name: OnBeforeClose
Type: `func(ctx context.Context) bool` -### WindowStartState - -Defines how the window should present itself at startup. - -| Value | Win | Mac | Lin | -| ---------- | --- | --- | --- | -| Fullscreen | ✅ | ✅ | ✅ | -| Maximised | ✅ | ✅ | ✅ | -| Minimised | ✅ | ❌ | ✅ | - -Name: WindowStartState
-Type: `options.WindowStartState` - ### CSSDragProperty Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`. @@ -415,6 +413,21 @@ Indicates what value the `CSSDragProperty` style should have to drag the window. Name: CSSDragValue
Type: `string` +### ZoomFactor + +Name: ZoomFactor
+Type: `float64` + +This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. + +### IsZoomControlEnabled + +Name: IsZoomControlEnabled
+Type: `bool` + +This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while +disallowing the user to change it at runtime (f.e. for a kiosk application or similar). + ### Bind A slice of struct instances defining methods that need to be bound to the frontend. @@ -451,7 +464,7 @@ by Windows. To configure this, use the [BackdropType](#BackdropType) option. Name: WindowIsTranslucent
Type: `bool` -#### BackdropType +#### BackdropType :::note @@ -467,12 +480,12 @@ Type `windows.BackdropType` The value can be one of the following: | Value | Description | -|---------|-------------------------------------------------------------------------------------------| +| ------- | ----------------------------------------------------------------------------------------- | | Auto | Let Windows decide which backdrop to use | | None | Do not use translucency | | Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect | | Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect | -| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | +| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | #### DisableWindowIcon @@ -510,21 +523,6 @@ Important information about distribution of fixed version runtime: Name: WebviewBrowserPath
Type: `string` -### ZoomFactor - -Name: ZoomFactor
-Type: `float64` - -This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. - -### IsZoomControlEnabled - -Name: IsZoomControlEnabled
-Type: `bool` - -This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while -disallowing the user to change it at runtime (f.e. for a kiosk application or similar). - #### Theme Minimum Windows Version: Windows 10 2004/20H1 diff --git a/website/i18n/fr/code.json b/website/i18n/fr/code.json new file mode 100644 index 00000000..fc78772a --- /dev/null +++ b/website/i18n/fr/code.json @@ -0,0 +1,415 @@ +{ + "homepage.Features.Title1": { + "message": "homepage.Features.Title1" + }, + "homepage.Features.Description1": { + "message": "homepage.Features.Description1" + }, + "homepage.Features.Title2": { + "message": "homepage.Features.Title2" + }, + "homepage.Features.Description2": { + "message": "homepage.Features.Description2" + }, + "homepage.Features.Title3": { + "message": "homepage.Features.Title3" + }, + "homepage.Features.Description3": { + "message": "homepage.Features.Description3" + }, + "homepage.Tagline": { + "message": "homepage.Tagline" + }, + "homepage.ButtonText": { + "message": "homepage.ButtonText" + }, + "homepage.LearnMoreButtonText": { + "message": "homepage.LearnMoreButtonText" + }, + "theme.ErrorPageContent.title": { + "message": "Cette page a planté.", + "description": "The title of the fallback page when the page crashed" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "Réessayer", + "description": "The label of the button to try again when the page crashed" + }, + "theme.NotFound.title": { + "message": "Page introuvable", + "description": "The title of the 404 page" + }, + "theme.NotFound.p1": { + "message": "Nous n'avons pas trouvé ce que vous recherchez.", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "Veuillez contacter le propriétaire du site qui vous a lié à l'URL d'origine et leur faire savoir que leur lien est cassé.", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Fermer", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.archive.title": { + "message": "Archive", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "Archive", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "Retour au début de la page", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "Pagination de la liste des articles du blog", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "Nouvelles entrées", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "Anciennes entrées", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.readingTime.plurals": { + "message": "Une minute de lecture|{readingTime} minutes de lecture", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.post.readMoreLabel": { + "message": "En savoir plus sur {title}", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readMore": { + "message": "Lire plus", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "Pagination des articles du blog", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "Article plus récent", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "Article plus ancien", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Navigation article de blog récent", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.blog.post.plurals": { + "message": "Un article|{count} articles", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} tagués avec « {tagName} »", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "Voir tous les tags", + "description": "The label of the link targeting the tag list page" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "Copier le code", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copied": { + "message": "Copié", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copy": { + "message": "Copier", + "description": "The copy button label on code blocks" + }, + "theme.colorToggle.ariaLabel": { + "message": "Basculer entre le mode sombre et clair (actuellement {mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "mode sombre", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "mode clair", + "description": "The name for the light color mode" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count} éléments", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "Déplier le menu latéral", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "Déplier le menu latéral", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "Pagination des documents", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "Précédent", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "Suivant", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "Réduire le menu latéral", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "Réduire le menu latéral", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "Plier/Déplier la catégorie '{label}' de la barre latérale", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "Un document tagué|{count} documents tagués", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged} avec \"{tagName}\"", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "Version: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "Ceci est la documentation de la prochaine version {versionLabel} de {siteTitle}.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "Ceci est la documentation de {siteTitle} {versionLabel}, qui n'est plus activement maintenue.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "Pour une documentation à jour, consultez la {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "dernière version", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "Éditer cette page", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "Lien direct vers le titre", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " le {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " par {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "Dernière mise à jour{atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Retour au menu principal", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "Versions", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.common.skipToMainContent": { + "message": "Aller au contenu principal", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsListLabel": { + "message": "Tags :", + "description": "The label alongside a tag list" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "Sur cette page", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "Langues", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.SearchBar.seeAll": { + "message": "Voir les {count} résultats" + }, + "theme.SearchBar.label": { + "message": "Chercher", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "Un document trouvé|{count} documents trouvés", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "Résultats de recherche pour « {query} »", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "Rechercher dans la documentation", + "description": "The search page title for empty query" + }, + "theme.SearchPage.inputPlaceholder": { + "message": "Tapez votre recherche ici", + "description": "The placeholder for search page input" + }, + "theme.SearchPage.inputLabel": { + "message": "Chercher", + "description": "The ARIA label for search page input" + }, + "theme.SearchPage.algoliaLabel": { + "message": "Recherche par Algolia", + "description": "The ARIA label for Algolia mention" + }, + "theme.SearchPage.noResultsText": { + "message": "Aucun résultat trouvé", + "description": "The paragraph for empty search result" + }, + "theme.SearchPage.fetchingNewResults": { + "message": "Chargement de nouveaux résultats...", + "description": "The paragraph for fetching new search results" + }, + "theme.tags.tagsPageTitle": { + "message": "Tags", + "description": "The title of the tag list page" + }, + "theme.docs.breadcrumbs.home": { + "message": "Page d'accueil", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "Fil d'Ariane", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "Activer/désactiver le retour à la ligne", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.admonition.note": { + "message": "remarque", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "astuce", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.danger": { + "message": "danger", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "info", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.caution": { + "message": "attention", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.SearchModal.searchBox.resetButtonTitle": { + "message": "Effacer la requête", + "description": "The label and ARIA label for search box reset button" + }, + "theme.SearchModal.searchBox.cancelButtonText": { + "message": "Annuler", + "description": "The label and ARIA label for search box cancel button" + }, + "theme.SearchModal.startScreen.recentSearchesTitle": { + "message": "Récemment", + "description": "The title for recent searches" + }, + "theme.SearchModal.startScreen.noRecentSearchesText": { + "message": "Aucune recherche récente", + "description": "The text when no recent searches" + }, + "theme.SearchModal.startScreen.saveRecentSearchButtonTitle": { + "message": "Sauvegarder cette recherche", + "description": "The label for save recent search button" + }, + "theme.SearchModal.startScreen.removeRecentSearchButtonTitle": { + "message": "Supprimer cette recherche de l'historique", + "description": "The label for remove recent search button" + }, + "theme.SearchModal.startScreen.favoriteSearchesTitle": { + "message": "Favoris", + "description": "The title for favorite searches" + }, + "theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": { + "message": "Supprimer cette recherche des favoris", + "description": "The label for remove favorite search button" + }, + "theme.SearchModal.errorScreen.titleText": { + "message": "Impossible de récupérer les résultats", + "description": "The title for error screen of search modal" + }, + "theme.SearchModal.errorScreen.helpText": { + "message": "Vous pouvez vérifier votre connexion réseau.", + "description": "The help text for error screen of search modal" + }, + "theme.SearchModal.footer.selectText": { + "message": "sélectionner", + "description": "The explanatory text of the action for the enter key" + }, + "theme.SearchModal.footer.selectKeyAriaLabel": { + "message": "Touche Entrée", + "description": "The ARIA label for the Enter key button that makes the selection" + }, + "theme.SearchModal.footer.navigateText": { + "message": "naviguer", + "description": "The explanatory text of the action for the Arrow up and Arrow down key" + }, + "theme.SearchModal.footer.navigateUpKeyAriaLabel": { + "message": "Flèche vers le haut", + "description": "The ARIA label for the Arrow up key button that makes the navigation" + }, + "theme.SearchModal.footer.navigateDownKeyAriaLabel": { + "message": "Flèche vers le bas", + "description": "The ARIA label for the Arrow down key button that makes the navigation" + }, + "theme.SearchModal.footer.closeText": { + "message": "fermer", + "description": "The explanatory text of the action for Escape key" + }, + "theme.SearchModal.footer.closeKeyAriaLabel": { + "message": "Touche Echap", + "description": "The ARIA label for the Escape key button that close the modal" + }, + "theme.SearchModal.footer.searchByText": { + "message": "Recherche via", + "description": "The text explain that the search is making by Algolia" + }, + "theme.SearchModal.noResultsScreen.noResultsText": { + "message": "Aucun résultat pour", + "description": "The text explains that there are no results for the following search" + }, + "theme.SearchModal.noResultsScreen.suggestedQueryText": { + "message": "Essayez de chercher", + "description": "The text for the suggested query when no results are found for the following search" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsText": { + "message": "Vous pensez que cette requête doit donner des résultats ?", + "description": "The text for the question where the user thinks there are missing results" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": { + "message": "Faites-le nous savoir.", + "description": "The text for the link to report missing results" + }, + "theme.SearchModal.placeholder": { + "message": "Rechercher des docs", + "description": "The placeholder of the input of the DocSearch pop-up modal" + } +} diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx new file mode 100644 index 00000000..648d4262 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx @@ -0,0 +1,161 @@ +--- +slug: wails-v2-beta-pour-windows +title: Wails v2 Beta pour Windows +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Quand j'ai annoncé Wails pour la première fois sur Reddit, il y a deux ans depuis un train à Sydney, je n'espérais pas autant d'attention. Quelques jours plus tard, un tech vlogger populaire a publié un tutoriel vidéo, a effectué une revue positive et à partir de ça, l'intérêt du projet n'a fait que croître. + +Il était clair que des gens étaient excités au fait de pouvoir ajouter des frontends web à leurs projets en Go, et presque immédiatement ça a poussé le projet bien plus loin que la preuve de concept que j'avais créé. A ce moment, Wails utilisait le projet [webview](https://github.com/webview/webview) pour gérer le frontend, et la seule option pour Windows était le moteur de rendu IE11. Beaucoup de bugs ont été ouverts à cause de cette limitation : support faible du JavaScript/CSS et accès à aucun outil de développement pour le déboguer. C'était une expérience de développement frustrante, mais il n'y avait pas grand-chose qui pouvait être fait pour le rectifier. + +Durant un long moment, je croyais fermement que Microsoft allait devoir faire quelque chose pour améliorer la situation de leur navigateur. Le monde avançait, le développement frontend était en plein boom, mais IE n'était pas à la hauteur. When Microsoft announced the move to using Chromium as the basis for their new browser direction, I knew it was only a matter of time until Wails could use it, and move the Windows developer experience to the next level. + +Today, I am pleased to announce: **Wails v2 Beta for Windows**! There's a huge amount to unpack in this release, so grab a drink, take a seat and we'll begin... + +### No CGO Dependency! + +No, I'm not joking: _No_ _CGO_ _dependency_ 🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path. + +### WebView2 Chromium Renderer + +```mdx-code-block +
+ +
+
+``` + +Finally, Windows developers get a first class rendering engine for their applications! Gone are the days of contorting your frontend code to work on Windows. On top of that, you get a first-class developer tools experience! + +The WebView2 component does, however, have a requirement to have the `WebView2Loader.dll` sitting alongside the binary. This makes distribution just that little bit more painful than we gophers are used to. All solutions and libraries (that I know of) that use WebView2 have this dependency. + +However, I'm really excited to announce that Wails applications _have no such requirement_! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk. + +Gophers rejoice! The single binary dream lives on! + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +There is now the option to generate IDE configuration along with your project. This means that if you open your project in a supported IDE, it will already be configured for building and debugging your application. Currently VSCode is supported but we hope to support other IDEs such as Goland soon. + +```mdx-code-block +
+ +
+
+``` + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +```mdx-code-block +
+ +
+
+``` + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### In Conclusion + +Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome. Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +There were many twists and turns, pivots and u-turns to get to this point. This was due partly to early technical decisions that needed changing, and partly because some core problems we had spent time building workarounds for were fixed upstream: Go’s embed feature is a good example. Fortunately, everything came together at the right time, and today we have the very best solution that we can have. I believe the wait has been worth it - this would not have been possible even 2 months ago. + +I also need to give a huge thank you :pray: to the following people because without them, this release just wouldn't exist: + +- [Misite Bao](https://github.com/misitebao) - An absolute workhorse on the Chinese translations and an incredible bug finder. +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version we have today possible. +- [Tad Vizbaras](https://github.com/tadvi) - Experimenting with his [winc](https://github.com/tadvi/winc) project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - His support, encouragement and feedback has really helped drive the project forward. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: MacOS and Linux users need not feel left out - porting to this new foundation is actively under way and most of the hard work has already been done. Hang in there! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx new file mode 100644 index 00000000..76ae8c80 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx @@ -0,0 +1,170 @@ +--- +slug: wails-v2-beta-for-mac +title: Wails v2 Beta for MacOS +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Today marks the first beta release of Wails v2 for Mac! It's taken quite a while to get to this point and I'm hoping that today's release will give you something that's reasonably useful. There have been a number of twists and turns to get to this point and I'm hoping, with your help, to iron out the crinkles and get the Mac port polished for the final v2 release. + +You mean this isn't ready for production? For your use case, it may well be ready, but there are still a number of known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would like to contribute, you'd be very welcome! + +So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### Mac Specific Options + +In addition to the normal application options, Wails v2 for Mac also brings some Mac extras: + +- Make your window all funky and translucent, like all the pretty swift apps! +- Highly customisable titlebar +- We support the NSAppearance options for the application +- Simple config to auto-create an "About" menu + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Native M1 Support + +Thanks to the amazing support of [Mat Ryer](https://github.com/matryer/), the Wails project now supports M1 native builds: + +```mdx-code-block +
+ +
+
+``` + +You can also specify `darwin/amd64` as a target too: + +```mdx-code-block +
+ +
+
+``` + +Oh, I almost forgot.... you can also do `darwin/universal`.... :wink: + +```mdx-code-block +
+ +
+
+``` + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### WKWebView Renderer + +V1 relied on a (now deprecated) WebView component. V2 uses the most recent WKWebKit component so expect the latest and greatest from Apple. + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: Linux users, you're next! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx new file mode 100644 index 00000000..eb7f2a46 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx @@ -0,0 +1,114 @@ +--- +slug: wails-v2-beta-for-linux +title: Wails v2 Beta for Linux +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +I'm pleased to finally announce that Wails v2 is now in beta for Linux! It is somewhat ironic that the very first experiments with v2 was on Linux and yet it has ended up as the last release. That being said, the v2 we have today is very different from those first experiments. So without further ado, let's go over the new features: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +Linux is **hard** to support. We expect there to be a number of quirks with the beta. Please help us to help you by filing detailed bug reports! + +Finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors) whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: The v2 release isn't far off now! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx b/website/i18n/fr/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx new file mode 100644 index 00000000..e9d570af --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx @@ -0,0 +1,98 @@ +--- +slug: wails-v2-released +title: Wails v2 Released +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +# It's here! + +Today marks the release of [Wails](https://wails.io) v2. It's been about 18 months since the first v2 alpha and about a year from the first beta release. I'm truly grateful to everyone involved in the evolution of the project. + +Part of the reason it took that long was due to wanting to get to some definition of completeness before officially calling it v2. The truth is, there's never a perfect time to tag a release - there's always outstanding issues or "just one more" feature to squeeze in. What tagging an imperfect major release does do, however, is to provide a bit of stability for users of the project, as well as a bit of a reset for the developers. + +This release is more than I'd ever expected it to be. I hope it gives you as much pleasure as it has given us to develop it. + +# What _is_ Wails? + +If you are unfamiliar with Wails, it is a project that enables Go programmers to provide rich frontends for their Go programs using familiar web technologies. It's a lightweight, Go alternative to Electron. Much more information can be found on the [official site](https://wails.io/docs/introduction). + +# What's new? + +The v2 release is a huge leap forward for the project, addressing many of the pain points of v1. If you have not read any of the blog posts on the Beta releases for [macOS](/blog/wails-v2-beta-for-mac), [Windows](/blog/wails-v2-beta-for-windows) or [Linux](/blog/wails-v2-beta-for-linux), then I encourage you to do so as it covers all the major changes in more detail. In summary: + +- Webview2 component for Windows that supports modern web standards and debugging capabilities. +- [Dark / Light theme](/docs/reference/options#theme) + [custom theming](/docs/reference/options#customtheme) on Windows. +- Windows now has no CGO requirements. +- Out-of-the-box support for Svelte, Vue, React, Preact, Lit & Vanilla project templates. +- [Vite](https://vitejs.dev/) integration providing a hot-reload development environment for your application. +- Native application [menus](/docs/guides/application-development#application-menu) and [dialogs](/docs/reference/runtime/dialog). +- Native window translucency effects for [Windows](/docs/reference/options#windowistranslucent) and [macOS](/docs/reference/options#windowistranslucent-1). Support for Mica & Acrylic backdrops. +- Easily generate an [NSIS installer](/docs/guides/windows-installer) for Windows deployments. +- A rich [runtime library](/docs/reference/runtime/intro) providing utility methods for window manipulation, eventing, dialogs, menus and logging. +- Support for [obfuscating](/docs/guides/obfuscated) your application using [garble](https://github.com/burrowers/garble). +- Support for compressing your application using [UPX](https://upx.github.io/). +- Automatic Typescript generation of Go structs. More info [here](/docs/howdoesitwork#calling-bound-go-methods). +- No extra libraries or DLLs are required to be shipped with your application. For any platform. +- No requirement to bundle frontend assets. Just develop your application like any other web application. + +# Credit & Thanks + +Getting to v2 has been a huge effort. There have been ~2.2K commits by 89 contributors between the initial alpha and the release today, and many, many more that have provided translations, testing, feedback and help on the discussion forums as well as the issue tracker. I'm so unbelievably grateful to each one of you. I'd also like to give an extra special thank you to all the project sponsors who have provided guidance, advice and feedback. Everything you do is hugely appreciated. + +There are a few people I'd like to give special mention to: + +Firstly, a **huge** thank you to [@stffabi](https://github.com/stffabi) who has provided so many contributions which we all benefit from, as well as providing a lot of support on many issues. He has provided some key features such as the external dev server support which transformed our dev mode offering by allowing us to hook into [Vite](https://vitejs.dev/)'s superpowers. It's fair to say that Wails v2 would be a far less exciting release without his [incredible contributions](https://github.com/wailsapp/wails/commits?author=stffabi&since=2020-01-04). Thank you so much @stffabi! + +I'd also like to give a huge shout-out to [@misitebao](https://github.com/misitebao) who has tirelessly been maintaining the website, as well as providing Chinese translations, managing Crowdin and helping new translators get up to speed. This is a hugely important task, and I'm extremely grateful for all the time and effort put into this! You rock! + +Last, but not least, a huge thank you to Mat Ryer who has provided advice and support during the development of v2. Writing xBar together using an early Alpha of v2 was helpful in shaping the direction of v2, as well as give me an understanding of some design flaws in the early releases. I'm happy to announce that as of today, we will start to port xBar to Wails v2, and it will become the flagship application for the project. Cheers Mat! + +# Lessons Learnt + +There are a number of lessons learnt in getting to v2 that will shape development moving forward. + +## Smaller, Quicker, Focused Releases + +In the course of developing v2, there were many features and bug fixes that were developed on an ad-hoc basis. This led to longer release cycles and were harder to debug. Moving forward, we are going to create releases more often that will include a reduced number of features. A release will involve updates to documentation as well as thorough testing. Hopefully, these smaller, quicker, focussed releases will lead to fewer regressions and better quality documentation. + +## Encourage Engagement + +When starting this project, I wanted to immediately help everyone who had a problem. Issues were "personal" and I wanted them resolved as quickly as possible. This is unsustainable and ultimately works against the longevity of the project. Moving forward, I will be giving more space for people to get involved in answering questions and triaging issues. It would be good to get some tooling to help with this so if you have any suggestions, please join in the discussion [here](https://github.com/wailsapp/wails/discussions/1855). + +## Learning to say No + +The more people that engage with an Open Source project, the more requests there will be for additional features that may or may not be useful to the majority of people. These features will take an initial amount of time to develop and debug, and incur an ongoing maintenance cost from that point on. I myself am the most guilty of this, often wanting to "boil the sea" rather than provide the minimum viable feature. Moving forward, we will need to say "No" a bit more to adding core features and focus our energies on a way to empower developers to provide that functionality themselves. We are looking seriously into plugins for this scenario. This will allow anyone to extend the project as they see fit, as well as providing an easy way to contribute towards the project. + +# Looking to the Future + +There are so many core features we are looking at to add to Wails in the next major development cycle already. The [roadmap](https://github.com/wailsapp/wails/discussions/1484) is full of interesting ideas, and I'm keen to start work on them. One of the big asks has been for multiple window support. It's a tricky one and to do it right, and we may need to look at providing an alternative API, as the current one was not designed with this in mind. Based on some preliminary ideas and feedback, I think you'll like where we're looking to go with it. + +I'm personally very excited at the prospect of getting Wails apps running on mobile. We already have a demo project showing that it is possible to run a Wails app on Android, so I'm really keen to explore where we can go with this! + +A final point I'd like to raise is that of feature parity. It has long been a core principle that we wouldn't add anything to the project without there being full cross-platform support for it. Whilst this has proven to be (mainly) achievable so far, it has really held the project back in releasing new features. Moving forward, we will be adopting a slightly different approach: any new feature that cannot be immediately released for all platforms will be released under an experimental configuration or API. This allows early adopters on certain platforms to try the feature and provide feedback that will feed into the final design of the feature. This, of course, means that there are no guarantees of API stability until it is fully supported by all the platforms it can be supported on, but at least it will unblock development. + +# Final Words + +I'm really proud of what we've been able to achieve with the V2 release. It's amazing to see what people have already been able to build using the beta releases so far. Quality applications like [Varly](https://varly.app/), [Surge](https://getsurge.io/) and [October](https://october.utf9k.net/). I encourage you to check them out. + +This release was achieved through the hard work of many contributors. Whilst it is free to download and use, it has not come about through zero cost. Make no mistakes, this project has come at considerable cost. It has not only been my time and the time of each and every contributor, but also the cost of absence from friends and families of each of those people too. That's why I'm extremely grateful for every second that has been dedicated to making this project happen. The more contributors we have, the more this effort can be spread out and the more we can achieve together. I'd like to encourage you all to pick one thing that you can contribute, whether it is confirming someone's bug, suggesting a fix, making a documentation change or helping out someone who needs it. All of these small things have such a huge impact! It would be so awesome if you too were part of the story in getting to v3. + +Enjoy! + +‐ Lea + +PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/authors.yml b/website/i18n/fr/docusaurus-plugin-content-blog/authors.yml new file mode 100644 index 00000000..8de1d564 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/authors.yml @@ -0,0 +1,10 @@ +leaanthony: + name: Lea Anthony + title: Mainteneur de Wails + url: https://github.com/leaanthony + image_url: https://github.com/leaanthony.png +misitebao: + name: Misite Bao + title: Architecte + url: https://github.com/misitebao + image_url: https://github.com/misitebao.png diff --git a/website/i18n/fr/docusaurus-plugin-content-blog/options.json b/website/i18n/fr/docusaurus-plugin-content-blog/options.json new file mode 100644 index 00000000..ac80a1f4 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Publications récentes", + "description": "The label for the left sidebar" + } +} diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current.json b/website/i18n/fr/docusaurus-plugin-content-docs/current.json new file mode 100644 index 00000000..f9fa85ba --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "Prochaine version 🚧", + "description": "The label for version current" + }, + "sidebar.docs.category.Getting Started": { + "message": "Pour démarrer", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Références", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Exécution", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Communauté", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Galerie", + "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": "Tutoriels", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.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/current/community/links.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx new file mode 100644 index 00000000..3f9ebf2f --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/links.mdx @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +--- + +# Links + +This page serves as a list for community related links. Please submit a PR (click `Edit this page` at the bottom) to submit links. + +## Awesome Wails + +The [definitive list](https://github.com/wailsapp/awesome-wails) of links related to Wails. + +## Support Channels + +- [Gophers Slack Channel](https://gophers.slack.com/messages/CJ4P9F7MZ/) +- [Gophers Slack Channel Invite](https://invite.slack.golangbridge.org/) +- [Github Issues](https://github.com/wailsapp/wails/issues) +- [v2 Beta Discussion Board](https://github.com/wailsapp/wails/discussions/828) + +## Social Media + +- [Twitter](https://twitter.com/wailsapp) +- [Wails Chinese Community QQ Group](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Group number: 1067173054 + +## Other Tutorials and Articles +- [Building of Bulletin Board](https://blog.customct.com/building-bulletin-board) 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 new file mode 100644 index 00000000..04150ba2 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx @@ -0,0 +1,10 @@ +# EmailIt + +```mdx-code-block +

+ +
+

+``` + +[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 builtin [Node-Red](https://nodered.org/) server, scripts terminal, and the [ScriptBar](https://github.com/raguay/ScriptBarApp) program for displaying results from Node-Red or a script on your system. Documentation is very scarce, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx new file mode 100644 index 00000000..7504950e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx @@ -0,0 +1,12 @@ +# EncryptEasy + +```mdx-code-block +

+ +
+

+``` + +**[EncryptEasy](https://www.encrypteasy.app) is a simple and easy to use PGP encryption tool, managing all your and your contacts keys. Encryption should be simple. Developed with Wails.** + +Encrypting messages using PGP is the industry standard. Everyone has a private and a public key. Your private key, well, needs to be kept private so only you can read messages. Your public key is distributed to anyone who wants to send you secret, encrypted messages. Managing keys, encrypting messages and decrypting messages should be a smooth experience. EncryptEasy is all about making it easy. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx new file mode 100644 index 00000000..134365aa --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx @@ -0,0 +1,16 @@ +# FileHound Export Utility + +```mdx-code-block +

+ +
+

+``` + +[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. + +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. + +Backend built with: 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 diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx new file mode 100644 index 00000000..2f6c7c72 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx @@ -0,0 +1,14 @@ +# Minecraft Updater + +```mdx-code-block +

+ +
+

+``` + +[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. 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 new file mode 100644 index 00000000..f8e2bcd6 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -0,0 +1,14 @@ +# Modal File Manager + +```mdx-code-block +

+ +
+

+``` + +[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. It is fully coded using Go and runs much faster than the previous versions. + +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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx new file mode 100644 index 00000000..5d846d06 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx @@ -0,0 +1,10 @@ +# Molley Wallet + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/october.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/october.mdx new file mode 100644 index 00000000..66d634dc --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/october.mdx @@ -0,0 +1,14 @@ +# October + +```mdx-code-block +

+ +
+

+``` + +[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). + +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/)! + +In contrast, the author's previous attempts with Electron quickly bloated to several hundred megabytes. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx new file mode 100644 index 00000000..4f87479d --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx @@ -0,0 +1,10 @@ +# Optimus + +```mdx-code-block +

+ +
+

+``` + +[Optimus](https://github.com/splode/optimus) is a desktop image optimization application. It supports conversion and compression between WebP, JPEG, and PNG image formats. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx new file mode 100644 index 00000000..03e740f4 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx @@ -0,0 +1,10 @@ +# Portfall + +```mdx-code-block +

+ +
+

+``` + +[Portfall](https://github.com/rekon-oss/portfall) - A desktop k8s port-forwarding portal for easy access to all your cluster UIs diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx new file mode 100644 index 00000000..3646384e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx @@ -0,0 +1,12 @@ +# Restic Browser + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx new file mode 100644 index 00000000..9928b478 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx @@ -0,0 +1,21 @@ +# RiftShare + +```mdx-code-block +

+ +
+

+``` + +Easy, Secure, and Free file sharing for everyone. Learn more at [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! 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 new file mode 100644 index 00000000..2ccb2acb --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -0,0 +1,10 @@ +# ScriptBar + +```mdx-code-block +

+ +
+

+``` + +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) is a program to show the output of the embedded [Node-Red](https://nodered.org) server in the [EmailIt](https://GitHub.com/raguay/EmailIt) application. 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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx new file mode 100644 index 00000000..c3b3fb4c --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx @@ -0,0 +1,10 @@ +# Surge + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx new file mode 100644 index 00000000..7408aa58 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx @@ -0,0 +1,10 @@ +# Wally + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx new file mode 100644 index 00000000..f100c55e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx @@ -0,0 +1,10 @@ +# Wombat + +```mdx-code-block +

+ +
+

+``` + +[Wombat](https://github.com/rogchap/wombat) is a cross platform gRPC client. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx new file mode 100644 index 00000000..5db428f7 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx @@ -0,0 +1,10 @@ +# Ytd + +```mdx-code-block +

+ +
+

+``` + +[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. 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 new file mode 100644 index 00000000..7f27ab70 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -0,0 +1,56 @@ +--- +sidebar_position: 1 +--- + +# Templates + +This page serves as a list for community supported templates. Please submit a PR (click `Edit this page` at the bottom) to include your templates. To build your own template, please see the [Templates](../guides/templates.mdx) guide. + +To use these templates, run `wails init -n "Your Project Name" -t [the link below[@version]]` + +If there is no version suffix, the main branch code template is used by default. If there is a version suffix, the code template corresponding to the tag of this version is used. + +Example: `wails init -n "Your Project Name" -t https://github.com/misitebao/wails-template-vue` + +:::warning Attention + +**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!** + +If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed. + +::: + +## Vue + +- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - Wails template based on Vue ecology (Integrated TypeScript, Dark theme, Internationalization, Single page routing, TailwindCSS) +- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript with Vite (and instructions to add features) +- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier +- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - A template using JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) +- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - A template using TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API with <script setup>) + +## Angular + +- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n + +## React + +- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - A template using reactjs +- [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 + +## 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-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit + +## Elm + +- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket: +- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Combine the powers :muscle: of Elm + Tailwind CSS + Wails! Hot reloading supported. + +## Pure JavaScript (Vanilla) + +- [wails-pure-js-template](https://github.com/KiddoV/wails-pure-js-template) - A template with nothing but just basic JavaScript, HTML, and CSS diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx new file mode 100644 index 00000000..a1f69f03 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx @@ -0,0 +1,22 @@ +--- +sidebar_position: 6 +--- + +# Compiling your Project + +From the project directory, run `wails build`. This will compile your project and save the production-ready binary in the `build/bin` directory. + +If you run the binary, you should see the default application: + +```mdx-code-block +
+ +
+
+``` + +For more details on compilation options, please refer to the [CLI Reference](../reference/cli.mdx#build). diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx new file mode 100644 index 00000000..a0075ef6 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx @@ -0,0 +1,16 @@ +--- +sidebar_position: 5 +--- + +# Developing your Application + +You can run your application in development mode by running `wails dev` from your project directory. This will do the following things: + +- Build your application and run it +- Bind your Go code to the frontend so it can be called from Javascript +- Using the power of [Vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change +- Sets up a [webserver](http://localhost:34115) that will serve your application over a browser. This allows you to use your favourite browser extensions. You can even call your Go code from the console + +To get started, run `wails dev` in the project directory. More information on this can be found [here](../reference/cli.mdx#dev). + +Coming soon: Tutorial diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx new file mode 100644 index 00000000..3428906e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 2 +--- + +# Creating a Project + +## Project Generation + +Now that the CLI is installed, you can generate a new project by using the `wails init` command. + +Pick your favourite framework: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Generate a Svelte project using Javascript with:

+ + wails init -n myproject -t svelte + +If you would rather use Typescript:
+ + wails init -n myproject -t svelte-ts + +
+ + Generate a React project using Javascript with:

+ + wails init -n myproject -t react + +If you would rather use Typescript:
+ + wails init -n myproject -t react-ts + +
+ + Generate a Vue project using Javascript with:

+ + wails init -n myproject -t vue + +If you would rather use Typescript:
+ + wails init -n myproject -t vue-ts + +
+ + Generate a Preact project using Javascript with:

+ + wails init -n myproject -t preact + +If you would rather use Typescript:
+ + wails init -n myproject -t preact-ts + +
+ + Generate a Lit project using Javascript with:

+ + wails init -n myproject -t lit + +If you would rather use Typescript:
+ + wails init -n myproject -t lit-ts + +
+ + Generate a Vanilla project using Javascript with:

+ + wails init -n myproject -t vanilla + +If you would rather use Typescript:
+ + wails init -n myproject -t vanilla-ts + +
+
+``` + +
+ +There are also [community templates](../community/templates.mdx) available that offer different capabilities and frameworks. + +To see the other options available, you can run `wails init -help`. More details can be found in the [CLI Reference](../reference/cli.mdx#init). + +## Project Layout + +Wails projects have the following layout: + +``` +. +├── build/ +│ ├── appicon.png +│ ├── darwin/ +│ └── windows/ +├── frontend/ +├── go.mod +├── go.sum +├── main.go +└── wails.json +``` + +### Project structure rundown + +- `/main.go` - The main application +- `/frontend/` - Frontend project files +- `/build/` - Project build directory +- `/build/appicon.png` - The application icon +- `/build/darwin/` - Mac specific project files +- `/build/windows/` - Windows specific project files +- `/wails.json` - The project configuration +- `/go.mod` - Go module file +- `/go.sum` - Go module checksum file + +The `frontend` directory has nothing specific to Wails and can be any frontend project of your choosing. + +The `build` directory is used during the build process. These files may be updated to customise your builds. If files are removed from the build directory, default versions will be regenerated. + +The default module name in `go.mod` is "changeme". You should change this to something more appropriate. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx new file mode 100644 index 00000000..fcfdf9ca --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx @@ -0,0 +1,90 @@ +--- +sidebar_position: 1 +--- + +# Installation + +## Supported Platforms + +- Windows 10/11 AMD64/ARM64 +- MacOS 10.13+ AMD64 +- MacOS 11.0+ ARM64 +- Linux AMD64/ARM64 + +## Dependencies + +Wails has a number of common dependencies that are required before installation: + +- Go 1.18+ +- NPM (Node 15+) + +### Go + +Download Go from the [Go Downloads Page](https://go.dev/dl/). + +Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks: + +- Check Go is installed correctly: `go version` +- Check "~/go/bin" is in your PATH variable: `echo $PATH | grep go/bin` + +### NPM + +Download NPM from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against. + +Run `npm --version` to verify. + +## Platform Specific Dependencies + +You will also need to install platform specific dependencies: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Wails requires that the xcode command line tools are installed. This can be + done by running xcode-select --install. + + + Wails requires that the WebView2 runtime is installed. Some Windows installations will already have this installed. You can check using the wails doctor command. + + + Linux required the standard gcc build tools plus libgtk3 and libwebkit. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run wails doctor after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please consult the Add Linux Distro guide. + + +``` + +## Optional Dependencies + +- [UPX](https://upx.github.io/) for compressing your applications. +- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers. + +## Installing Wails + +Run `go install github.com/wailsapp/wails/v2/cmd/wails@latest` to install the Wails CLI. + +Note: If you get an error similar to this: + +```shell +....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found +``` +please check you have Go 1.18+ installed: +```shell +go version +``` + +## System Check + +Running `wails doctor` will check if you have the correct dependencies installed. If not, it will advise on what is missing and help on how to rectify any problems. + +## The `wails` command appears to be missing? + +If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/angular.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/angular.mdx new file mode 100644 index 00000000..2b6c5a84 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/angular.mdx @@ -0,0 +1,14 @@ +# Angular + +Whilst Wails does not have an Angular template, it is possible to use Angular with Wails. + +## Dev Mode + +To get dev mode working with Angular, you need to add the following to your `wails.json`: + +```json + "frontend:build": "npx ng build", + "frontend:install": "npm install", + "frontend:dev:watcher": "npx ng serve", + "frontend:dev:serverUrl": "http://localhost:4200", +``` \ No newline at end of file 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 new file mode 100644 index 00000000..a618076f --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -0,0 +1,194 @@ +# Application Development + +There are no hard and fast rules for developing applications with Wails, but there are some basic guidelines. + +## Application Setup + +The pattern used by the default templates are that `main.go` is used for configuring and running the application, whilst `app.go` is used for defining the application logic. + +The `app.go` file will define a struct that has 2 methods which act as hooks into the main application: + +```go title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} +``` + +- The startup method is called as soon as Wails allocates the resources it needs and is a good place for creating resources, setting up event listeners and anything else the application needs at startup. It is given a `context.Context` which is usually saved in a struct field. This context is needed for calling the [runtime](../reference/runtime/intro.mdx). If this method returns an error, the application will terminate. In dev mode, the error will be output to the console. + +- The shutdown method will be called by Wails right at the end of the shutdown process. This is a good place to deallocate memory and perform any shutdown tasks. + +The `main.go` file generally consists of a single call to `wails.Run()`, which accepts the application configuration. The pattern used by the templates is that before the call to `wails.Run()`, an instance of the struct we defined in `app.go` is created and saved in a variable called `app`. This configuration is where we add our callbacks: + +```go {3,9,10} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks). + +## Binding Methods + +It is likely that you will want to call Go methods from the frontend. This is normally done by adding public methods to the already defined struct in `app.go`: + +```go {16-18} title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +In the main application configuration, the `Bind` key is where we can tell Wails what we want to bind: + +```go {11-13} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods). + +### Dealing with context when binding multiple structs + +If you want to bind methods for multiple structs but want each struct to keep a reference to the context so that you can use the runtime functions, a good pattern is to pass the context from the `OnStartup` method to your struct instances : + +```go +func main() { + + app := NewApp() + otherStruct := NewOtherStruct() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: func(ctx context.Context){ + app.SetContext(ctx) + otherStruct.SetContext(ctx) + }, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + otherStruct + }, + }) + if err != nil { + log.Fatal(err) + } +} +``` + +More information on Binding can be found [here](../howdoesitwork.mdx#method-binding). + +## Application Menu + +Wails supports adding a menu to your application. This is done by passing a [Menu](../reference/menus.mdx#menu) struct to application config. It's common to use a method that returns a Menu, and even more common for that to be a method on the `App` struct used for the lifecycle hooks. + +```go {11} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Menu: app.menu(), + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +## Assets + +The great thing about the way Wails v2 handles assets is that it doesn't! The only thing you need to give Wails is an `embed.FS`. How you get to that is entirely up to you. You can use vanilla html/css/js files like the vanilla template. You could have some complicated build system, it doesn't matter. + +When `wails build` is run, it will check the `wails.json` project file at the project root. There are 2 keys in the project file that are read: + +- "frontend:install" +- "frontend:build" + +The first, if given, will be executed in the `frontend` directory to install the node modules. The second, if given, will be executed in the `frontend` directory to build the frontend project. + +If these 2 keys aren't given, then Wails does absolutely nothing with the frontend. It is only expecting that `embed.FS`. + +### AssetsHandler + +A Wails v2 app can optionally define a `http.Handler` in the `options.App`, which allows hooking into the AssetServer to create files on the fly or process POST/PUT requests. GET requests are always first handled by the `assets` FS. If the FS doesn't find the requested file the request will be forwarded to the `http.Handler` for serving. Any requests other than GET will be directly processed by the `AssetsHandler` if specified. It's also possible to only use the `AssetsHandler` by specifiy `nil` as the `Assets` option. + +## Built in Dev Server + +Running `wails dev` will start the built in dev server which will start a file watcher in your project directory. By default, if any file changes, wails checks if it was an application file (default: `.go`, configurable with `-e` flag). If it was, then it will rebuild your application and relaunch it. If the changed file was in the assets, it will issue a reload after a short amount of time. + +The dev server uses a technique called "debouncing" which means it doesn't reload straight away, as there may be multiple files changed in a short amount of time. When a trigger occurs, it waits for a set amount of time before issuing a reload. If another trigger happens, it resets to the wait time again. By default this value is `100ms`. If this value doesn't work for your project, it can be configured using the `-debounce` flag. If used, this value will be saved to your project config and become the default. + +## 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. + +## Go Module + +The default Wails templates generate a `go.mod` file that contains the module name "changeme". You should change this to something more appropriate after project generation. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx new file mode 100644 index 00000000..73173e15 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx @@ -0,0 +1,136 @@ +# Dynamic Assets + +If you want to load or generate assets for your frontend dynamically, you can achieve that using the [AssetsHandler](../reference/options#assetshandler) option. The AssetsHandler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the bundled assets because the file is not found. + +By installing a custom AssetsHandler, you can serve your own assets using a custom asset server. + +## Example + +In our example project, we will create a simple assets handler which will load files off disk: + +```go title=main.go {16-35,49} +package main + +import ( + "embed" + "fmt" + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "net/http" + "os" + "strings" +) + +//go:embed all:frontend/dist +var assets embed.FS + +type FileLoader struct { + http.Handler +} + +func NewFileLoader() *FileLoader { + return &FileLoader{} +} + +func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request) { + var err error + requestedFilename := strings.TrimPrefix(req.URL.Path, "/") + println("Requesting file:", requestedFilename) + fileData, err := os.ReadFile(requestedFilename) + if err != nil { + res.WriteHeader(http.StatusBadRequest) + res.Write([]byte(fmt.Sprintf("Could not load file %s", requestedFilename))) + } + + res.Write(fileData) +} + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "helloworld", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: NewFileLoader(), + }, + BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 255}, + OnStartup: app.startup, + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +When we run the application in dev mode using `wails dev`, we will see the following output: + +``` +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' failed, using AssetHandler +Requesting file: favicon.ico +``` + +As you can see, the assets handler is called when the default assets server is unable to serve the `favicon.ico` file. + +If you right click the main application and select "inspect" to bring up the devtools, you can test this feature out by typing the following into the console: + +``` +let response = await fetch('does-not-exist.txt'); +``` + +This will generate an error in the devtools. We can see that the error is what we expect, returned by our custom assets handler: + +```mdx-code-block +

+ +

+``` + +However, if we request `go.mod`, we will see the following output: + +```mdx-code-block +

+ +

+``` + +This technique can be used to load images directly into the page. If we updated our default vanilla template and replaced the logo image: + +```html + +``` + +with: + +```html + +``` + +Then we would see the following: + +```mdx-code-block +

+ +

+``` + +:::warning + +Exposing your filesystem in this way is a security risk. It is recommended that you properly manage access to your filesystem. + +::: diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frameless.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frameless.mdx new file mode 100644 index 00000000..3845736f --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frameless.mdx @@ -0,0 +1,87 @@ +# Frameless Applications + +Wails supports application that have no frames. This can be achieved by using the [frameless](../reference/options.mdx#frameless) field in [Application Options](../reference/options.mdx#application-options). + +Wails offers a simple solution for dragging the window: Any HTML element that has the CSS style `--wails-draggable:drag` will act as a "drag handle". This property applies to all child elements. If you need to indicate that a nested element should not drag, then use the attribute '--wails-draggable:no-drag' on that element. + +```html + + + + + + + +
+ + +
+
+ + + + +``` + +For some projects, using a CSS variable may not be possible due to dynamic styling. In this case, you can use the `CSSDragProperty` and `CSSDragValue` application options to define a property and value that will be used to indicate draggable regions: + +```go title=main.go +package main + +import ( + "embed" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "alwaysontop", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Frameless: true, + CSSDragProperty: "widows", + CSSDragValue: "1", + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +```html title=index.html + + + + + + alwaysontop + + +
+ + + +``` + +:::info Fullscreen + +If you allow your application to go fullscreen, this drag functionality will be disabled. + +::: diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frontend.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frontend.mdx new file mode 100644 index 00000000..ac087ee4 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/frontend.mdx @@ -0,0 +1,72 @@ +# Frontend + +## Script Injection + +When Wails serves your `index.html`, by default, it will inject 2 script entries into the `` tag to load `/wails/ipc.js` and `/wails/runtime.js`. These files install the bindings and runtime respectively. + +The code below shows where these are injected by default: + +```html + + + injection example + + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + +``` + +### Overriding Default Script Injection + +To provide more flexibility to developers, there is a meta tag that may be used to customise this behaviour: + +```html + +``` + +The options are as follows: + +| Value | Description | +| ------------------- | ------------------------------------------------ | +| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` | +| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` | +| noautoinject | Disable all autoinjection of scripts | + +Multiple options may be used provided they are comma seperated. + +This code is perfectly valid and operates the same as the autoinjection version: + +```html + + + injection example + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + + + +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/ides.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/ides.mdx new file mode 100644 index 00000000..f7428228 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/ides.mdx @@ -0,0 +1,127 @@ +# IDEs + +Wails aims to provide a great development experience. To that aim, we now support generating IDE specific configuration to provide smoother project setup. + +Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but aim to support other IDEs such as Goland. + +## Visual Studio Code + +```mdx-code-block +

+ +

+``` + +When generating a project using the `-ide vscode` flags, IDE files will be created alongside the other project files. These files are placed into the `.vscode` directory and provide the correct configuration for debugging your application. + +The 2 files generated are `tasks.json` and `launch.json`. Below are the files generated for the default vanilla project: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/myproject.exe" + ] + } + ] +} +``` + +```json title="launch.json" +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Wails: Debug myproject", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/build/bin/myproject.exe", + "preLaunchTask": "build", + "cwd": "${workspaceFolder}", + "env": {} + } + ] +} +``` + +### Configuring the install and build steps + +The `tasks.json` file is simple for the default project as there is no `npm install` or `npm run build` step needed. For projects that have a frontend build step, such as the svelte template, we would need to edit `tasks.json` to add the install and build steps: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "npm install", + "type": "npm", + "script": "install", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "npm run build", + "type": "npm", + "script": "build", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/vscode.exe" + ], + "dependsOn": ["npm install", "npm run build"] + } + ] +} +``` + +:::info Future Enhancement + +In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically. + +::: diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx new file mode 100644 index 00000000..8b25c157 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx @@ -0,0 +1,103 @@ +# Linux Distro Support + +## Overview + +Wails offers Linux support but providing installation instructions for all available distributions is an impossible task. Instead, Wails tries to determine if the packages you need to develop applications are available via your system's package manager. Currently, we support the following package managers: + +- apt +- dnf +- emerge +- eopkg +- nixpkgs +- pacman +- zypper + +## Adding package names + +There may be circumstances where your distro uses one of the supported package managers but the package name is different. For example, you may use an Ubuntu derivative, but the package name for gtk may be different. Wails attempts to find the correct package by iterating through a list of package names. The list of packages are stored in the packagemanager specific file in the `v2/internal/system/packagemanager` directory. In our example, this would be `v2/internal/system/packagemanager/apt.go`. + +In this file, the list of packages are defined by the `Packages()` method: + +```go +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +Let's assume that in our linux distro, `libgtk-3` is packaged under the name `lib-gtk3-dev`. We could add support for this by adding the following line: + +```go {5} +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + {Name: "lib-gtk3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +## Adding new package managers + +To add a new package manager, perform the following steps: + +- Create a new file in `v2/internal/system/packagemanager` called `.go`, where `` is the name of the package manager. +- Define a struct that conforms to the package manager interface defined in `pm.go`: + +```go +type PackageManager interface { + Name() string + Packages() packagemap + PackageInstalled(*Package) (bool, error) + PackageAvailable(*Package) (bool, error) + InstallCommand(*Package) string +} +``` + +- `Name()` should return the name of the package manager +- `Packages()` should return a `packagemap`, that provides candidate filenames for dependencies +- `PackageInstalled()` should return `true` if the given package is installed +- `PackageAvailable()` should return `true` if the given package is not installed but available for installation +- `InstallCommand()` should return the exact command to install the given package name + +Take a look at the other package managers code to get an idea how this works. + +:::info Remember + +If you add support for a new package manager, don't forget to also update this page! + +::: diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux.mdx new file mode 100644 index 00000000..229c282b --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/linux.mdx @@ -0,0 +1,18 @@ +# Linux + +This page has miscellaneous guides related to developing Wails applications for Linux. + +## Video tag doesn't fire "ended" event + +When using a video tag, the "ended" event is not fired when the video is finished playing. This is a bug in WebkitGTK, however you can use the following workaround to fix it: + +```js +videoTag.addEventListener("timeupdate", (event) => { + if (event.target.duration - event.target.currentTime < 0.2) { + let ended = new Event("ended"); + event.target.dispatchEvent(ended); + } +}); +``` + +Source: [Lyimmi](https://github.com/Lyimmi) on the [discussions board](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275) diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/local-development.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/local-development.mdx new file mode 100644 index 00000000..4ba1f34c --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/local-development.mdx @@ -0,0 +1,55 @@ +# Local Development + +## Overview + +Wails is in constant development and new releases are regularly "tagged". This usually happens when all the newer code on `master` has been tested and confirmed working. If you need a bugfix or feature that has not yet made it to a release, it's possible to use the latest "bleeding edge" version using the following steps: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails/v2/cmd/wails` +- `go install` + +NOTE: The directory that you cloned the project into will now be called "clonedir". + +The Wails CLI will now be at the very latest version. + +### Updating your project + +To update projects to use the latest version of the Wails library, update the project's `go.mod` and ensure the following line is at the bottom of the file: + +`replace github.com/wailsapp/wails/v2 => ` + +Example: + +On Windows: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2` + +On 'nix: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2` + +To revert to a stable version, run: + +`go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +## Testing a Branch + +If you want to test a branch, follow the instructions above, but ensure you switch the branch you want to test before installing: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git checkout -b branch-to-test --track origin/branch-to-test` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. + +## Testing a PR + +If you want to test a PR, follow the instructions above, but ensure you fetch the PR and switch the branch before installing. Please replace `[IDofThePR]` with the ID of the PR shown on github.com: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git fetch -u origin pull/[IDofThePR]/head:test/pr-[IDofThePR]` +- `git checkout test/pr-[IDofThePR]` +- `git reset --hard HEAD` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx new file mode 100644 index 00000000..dcf192d3 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx @@ -0,0 +1,95 @@ +# Manual Builds + +The Wails CLI does a lot of heavy lifting for the project, but sometimes it's desirable to manually build your project. This document will discuss the different operations the CLI does and how this may be achieved in different ways. + +## Build Process + +When either `wails build` or `wails dev` are used, the Wails CLI performs a common build process: + + - Install frontend dependencies + - Build frontend project + - Generate build assets + - Compile application + - [optional] Compress application + +### Install frontend dependencies + +#### CLI Steps + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is an install command in the key `frontend:install` +- If there isn't, it skips this step +- If there is, it checks if `package.json` exists in the frontend directory. If it doesn't exist, it skips this step +- An MD5 sum is generated from the `package.json` file contents +- It checks for the existence of `package.json.md5` and if it exists, will compare the contents of it (an MD5 sum) with the one generated to see if the contents have changed. If they are the same, this step is skipped +- If `package.json.md5` does not exist, it creates it using the generated MD5 sum +- If a build is now required, or `node_modules` does not exist, or the `-f` flag is given, the install command is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm install`. + +### Build frontend project + +#### Wails CLI + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is a build command in the key `frontend:build` +- If there isn't, it skips this step +- If there is, it is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm run build` or whatever the frontend build script is. + +### Generate assets + +#### Wails CLI + +- If `-nopackage` flag is set, this stage is skipped +- If the `build/appicon.png` file does not exist, a default one is created +- For Windows, see [Bundling for Windows](#windows) +- If `build/windows/icon.ico` does not exist, it will create it from the `build/appicon.png` image. + +##### Windows + +- If `build/windows/icon.ico` does not exist, it will create it from `build/appicon.png` using icon sizes of 256, 128, 64, 48, 32 and 16. This is done using [winicon](https://github.com/leaanthony/winicon). +- If the `build/windows/.manifest` file does not exist, it creates it from a default version. +- Compiles the application as a production build (above) +- Uses [winres](https://github.com/tc-hib/winres) to bundle the icon and manifest into a `.syso` file ready for linking. + +#### Manual Steps + +- Create `icon.ico` using the [winicon](https://github.com/leaanthony/winicon) CLI tool (or any other tool). +- Create / Update a `.manifest` file for your application +- Use the [winres CLI](https://github.com/tc-hib/go-winres) to generate a `.syso` file. + +### Compile application + +#### Wails CLI + +- If the `-clean` flag is provided, the `build` directory is deleted and recreated +- For `wails dev`, the following default Go flags are used: `-tags dev -gcflags "all=-N -l"` +- For `wails build`, the following default Go flags are used: `-tags desktop,production -ldflags "-w -s"` + - On Windows, `-ldflags "-w -h -H windowsgui"` +- Additional tags passed to the CLI using `-tags` are added to the defaults +- Additional ldflags passed to the CLI using `-ldflags` are added to the defaults +- The `-o` flag is passed through +- The Go compiler specified by `-compiler` will be used for compilation + +#### Manual steps + +- For dev build, the minimum command would be: `go build -tags dev -gcflags "all=-N -l"` +- For production build, the minimum command would be: `go build -tags desktop,production -ldflags "-w -s -H windowsgui"` +- Ensure that you compile in the same directory as the `.syso` file + +### Compress application + +#### Wails CLI + +- If the `-upx` flag has been given, the `upx` program will be run to compress the application with the default settings +- If `-upxflags` is also passed, these flags are used instead of the default ones + +#### Manual steps + +- Run `upx [flags]` manually to compress the application. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/migrating.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/migrating.mdx new file mode 100644 index 00000000..9915e230 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/migrating.mdx @@ -0,0 +1,191 @@ +# Migrating from v1 + +## Overview + +Wails v2 is a significant change from v1. This document aims to highlight the changes and the steps in migrating an existing project. + +### Creating the Application + +In v1, the main application is created using `wails.CreateApp`, bindings are added with `app.Bind`, then the application is run using `app.Run()`. + +Example: + +```go title="v1" + app := wails.CreateApp(&wails.AppConfig{ + Title: "MyApp", + Width: 1024, + Height: 768, + JS: js, + CSS: css, + Colour: "#131313", + }) + app.Bind(basic) + app.Run() +``` + +In v2, there is just a single method, `wails.Run()`, that accepts [application options](../reference/options.mdx#application-options). + +```go title="v2" + err := wails.Run(&options.App{ + Title: "MyApp", + Width: 800, + Height: 600, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + basic, + }, + }) +``` + +### Binding + +In v1, it was possible to bind both arbitrary functions and structs. In v2, this has been simplified to only binding structs. The struct instances that were previously passed to the `Bind()` method in v1, are now specified in the `Bind` field of the [application options](../reference/options.mdx#application-options): + +```go title="v1" + app := wails.CreateApp(/* options */) + app.Bind(basic) +``` + +```go title="v2" + err := wails.Run(&options.App{ + /* other options */ + Bind: []interface{}{ + basic, + }, + }) +``` + +In v1, bound methods were available to the frontend at `window.backend`. This has changed to `window.go`.`` + +### Application Lifecycle + +In v1, there were 2 special methods in a bound struct: `WailsInit()` and `WailsShutdown()`. These have been replaced with 3 lifecycle hooks as part of the [application options](../reference/options.mdx#application-options): + +- [OnStartup](../reference/options.mdx#onstartup) +- [OnShutdown](../reference/options.mdx#onshutdown) +- [OnDomReady](../reference/options.mdx#ondomready) + +Note: [OnDomReady](../reference/options.mdx#ondomready) replaces the `wails:ready` system event in v1. + +These methods can be standard functions, but a common practice is to have them part of a struct: + +```go title="v2" + basic := NewBasicApp() + err := wails.Run(&options.App{ + /* Other Options */ + OnStartup: basic.startup, + OnShutdown: basic.shutdown, + OnDomReady: basic.domready, + }) +... +type Basic struct { + ctx context.Context +} +func (b *Basic) startup(ctx context.Context) { + b.ctx = ctx +} +... +``` + +### Runtime + +The runtime in v2 is much richer than v1 with support for menus, window manipulation and better dialogs. The signature of the methods has changed slightly - please refer the the [Runtime Reference](../reference/runtime/intro.mdx). + +In v1, the [runtime](../reference/runtime/intro.mdx) was available via a struct passed to `WailsInit()`. In v2, the runtime has been moved out to its own package. Each method in the runtime takes the `context.Context` that is passed to the [OnStartup](../reference/options.mdx#onstartup) method. + +```go title="Runtime Example" +package main + +import "github.com/wailsapp/wails/v2/pkg/runtime" + +type Basic struct { + ctx context.Context +} + +// startup is called at application startup +func (a *App) startup(ctx context.Context) { + a.ctx = ctx + runtime.LogInfo(ctx, "Application Startup called!") +} + +``` + +### Assets + +The _biggest_ change in v2 is how assets are handled. + +In v1, assets were passed via 2 application options: + +- `JS` - The application's Javascript +- `CSS` - The application's CSS + +This meant that the responsibility of generating a single JS and CSS file was on the developer. This essentially required the use of complicated packers such as webpack. + +In v2, Wails makes no assumptions about your frontend assets, just like a webserver. All of your application assets are passed to the application options as an `embed.FS`. + +**This means there is no requirement to bundle your assets, encode images as Base64 or attempt the dark art of bundler configuration to use custom fonts**. + +At startup, Wails will scan the given `embed.FS` for `index.html` and use its location as the root path for all the other application assets - just like a webserver would. + +Example: An application has the following project layout. All final assets are placed in the `frontend/dist` directory: + +```shell +. +├── build/ +├── frontend/ +│ └── dist/ +│ ├── index.html +│ ├── main.js +│ ├── main.css +│ └── logo.svg +├── main.go +└── wails.json +``` + +Those assets may be used by the application by simply creating an `embed.FS`: + +```go title="Assets Example" +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + err := wails.Run(&options.App{ + /* Other Options */ + AssetServer: &assetserver.Options{ + Assets: assets, + }, + }) +} +``` + +Of course, bundlers can be used if you wish to. The only requirement is to pass the final application assets directory to Wails using an `embed.FS` in the `Assets` key of the [application options](../reference/options.mdx#application-options). + +### Project Configuration + +In v1, the project configuration was stored in the `project.json` file in the project root. In v2, the project configuration is stored in the `wails.json` file in the project root. + +The format of the file is slightly different. Here is a comparison: + +

+ +| v1 | v2 | Notes | +| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | name | | +| description | | Removed | +| author / name | author / name | | +| author / email | author / email | | +| version | version | | +| binaryname | outputfilename | Changed | +| frontend / dir | | Removed | +| frontend / install | frontend:install | Changed | +| frontend / build | frontend:build | Changed | +| frontend / bridge | | Removed | +| frontend / serve | | Removed | +| tags | | Removed | +| | wailsjsdir | The directory to generate wailsjs modules | +| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. | +| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. This is only needed for some more advanced asset configurations. | + +

diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx new file mode 100644 index 00000000..4a3de2a6 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx @@ -0,0 +1,25 @@ +# Mouse Buttons + +The Wails runtime intercepts mouse clicks to determine whether a frameless window needs resizing or a window needs to be moved. It has been asked how to detect when a mouse click has occurred, because `window.onclick` doesn't report the mouse buttons correctly. The following code shows how to detect mouse clicks: + +```javascript +window.addEventListener("mousedown", handleMouseButtonDown); + +function handleMouseButtonDown(event) { + if (event.button === 0) { + // left mouse button + } else if (event.button === 1) { + // middle mouse button + } else if (event.button === 2) { + // right mouse button + } else if (event.button === 3) { + // back mouse button + } else if (event.button === 4) { + // forward mouse button + } else { + // other mouse button + } +} +``` + +Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx new file mode 100644 index 00000000..21f7875e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx @@ -0,0 +1,40 @@ +# Obfuscated Builds + +Wails includes support for obfuscating your application using [garble](https://github.com/burrowers/garble). + +To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command: + +```bash +wails build -obfuscated +``` + +To customise the obfuscation settings, you can use the `-garbleargs` flag: + +```bash +wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed" +``` + +These settings may be persisted in your [project config](../reference/project-config). + +## How it works + +In a standard build, all bound methods are available in the frontend under the `window.go` variable. When these methods are called, the corresponding backend method is called using the fully qualified function name. When using an obfuscated build, methods are bound using an ID instead of a name. The bindings generated in the `wailsjs` directory use these IDs to call the backend functions. + +:::note + +To ensure that your application will work in obfuscated mode, you must use the generated bindings under the `wailsjs` directory in your application. + +::: + +## Example + +Importing the "Greet" method from the bindings like this: + +```js +import { Greet } from "../../wailsjs/go/main/App"; + +// snip +Greet("World"); +``` + +will ensure that the method will work correctly in obfuscated mode, as the bindings will be regenerated with IDs and the call mechanism updated. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/overscroll.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/overscroll.mdx new file mode 100644 index 00000000..9d1d772d --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/overscroll.mdx @@ -0,0 +1,10 @@ +# Overscroll + +[Overscroll](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) is the "bounce effect" you sometimes get when you scroll beyond a page's content boundaries. This is common in mobile apps. This can be disabled using CSS: + +```css +html { + height: 100%; + overflow: hidden; +} +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx new file mode 100644 index 00000000..c35cc1c8 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/routing.mdx @@ -0,0 +1,47 @@ +# Routing + +Routing is a popular way to switch views in an application. This page offers some guidance around how to do that. + +## Vue + +The recommended approach for routing in Vue is [Hash Mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode): + +```js +import { createRouter, createWebHashHistory } from "vue-router"; + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + //... + ], +}); +``` + +## Angular + +The recommended approach for routing in Angular is [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy): + +```ts +RouterModule.forRoot(routes, { useHash: true }); +``` + +## React + +The recommended approach for routing in React is [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router): + +```jsx +import { HashRouter } from "react-router-dom"; + +ReactDOM.render( + + {/* The rest of your app goes here */} + + } exact /> + } /> + } /> + {/* more... */} + + , + root +); +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/signing.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/signing.mdx new file mode 100644 index 00000000..4c7cf45b --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/signing.mdx @@ -0,0 +1,387 @@ +# Code Signing + +This is a guide on how you can sign your binaries generated with Wails on MacOS and Windows. The guide will target CI environments, more specifically GitHub Actions. + +## Windows + +First off you need a code signing certificate. If you do not already have one, Microsoft's info page lists some providers [here](https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate). Please note that an EV certificate is not required unless you need to write kernel-level software such as device drivers. For signing your Wails app, a standard code signing certificate will do just fine. + +It may be a good idea to check with your certificate provider how to sign your binaries on your local machine before targeting automated build systems, just so you know if there are any special requirements. For instance, [here](https://www.ssl.com/how-to/using-your-code-signing-certificate/) is SSL.com's code signing guide for Windows. If you know how to sign locally, it will be easier to troubleshoot any potential issues in a CI environment. For instance, SSL.com code signing certificates require the `/tr` flag for [SignTool.exe](https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool) while other providers may only need the `/t` flag for providing the timestamping server. Popular GitHub Actions for signing Windows binaries like [this one](https://github.com/Dana-Prajea/code-sign-action) does not support the `/tr` flag on SignTool.exe. Therefore this guide will focus on signing our app manually with PowerShell commands, but you can use actions like the [code-sign-action](https://github.com/Dana-Prajea/code-sign-action) Action if you prefer. + +First off, let's make sure we are able to build our Wails app in our GitHub CI. Here is a small workflow template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend manually here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +Next we need to give the GitHub workflow access to our signing certificate. This is done by encoding your .pfx or .p12 certificate into a base64 string. To do this in PowerShell, you can use the following command assuming your certificate is called 'my-cert.p12': + +```PowerShell +certutil -encode .\my-cert.p12 my-cert-base64.txt +``` + +You should now have your .txt file with the base64 encoded certificate. It should start with _-----BEGIN CERTIFICATE-----_ and end with _-----END CERTIFICATE-----_. Now you need to make two action secrets on GitHub. Navigate to _Settings -> Secrets -> Actions_ and create the two following secrets: + +- **WIN_SIGNING_CERT** with the contents of your base64 encoded certificate text. +- **WIN_SIGNING_CERT_PASSWORD** with the contents of your certificate password. + +Now we're ready to implement the signing in our workflow using one of the two methods: + +### Method 1: signing with commands + +This method uses PowerShell commands to sign our app, and leaves you control over the entire signing process. + +After the `"Build Wails app"` step, we can add the following step to our workflow: + +```yaml +- name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd /t /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' + +``` + +This script creates a new directory for your certificate file, creates the certificate file from our base64 secret, converts it to a .pfx file, and finally signs the binary. The following variables needs to be replaced in the last line: + +- **signing algorithm**: usually sha256. +- **timestamping server**: URL to the timestamping server to use with your certificate. +- **path to binary**: path to the binary you want to sign. + +Given that our Wails config has `outputfilename` set to "app.exe" and that we have a certificate from SSL.com, this would be our workflow: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\app.exe + + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +### Method 2: automatically signing with Action + +It is possible to use a Windows code signing Action like [this](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate) one, but note it requires a SHA1 hash for the certificate and a certificate name. View an example of how to configure it on the Action's [marketplace](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate). + +--- + +## MacOS + +First off you need your code signing certificate from Apple. If you do not have one, a simple Google search will help you acquire one. Once you have your certificate, you need to export it and encode it to base64. [This tutorial](https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions) shows you how to do that in an easy manner. Once you have exported your .p12 certificate file, you can encode it to base64 as seen in the tutorial with the following command: + +```bash +base64 Certificates.p12 | pbcopy +``` + +Now you're ready to create some GitHub project secrets, just as with Windows: + +- **APPLE_DEVELOPER_CERTIFICATE_P12_BASE64** with the contents of your newly copied base64 certificate. +- **APPLE_DEVELOPER_CERTIFICATE_PASSWORD** with the contents of your certificate password. +- **APPLE_PASSWORD** with the contents of an App-Specific password to your Apple-ID account which you can generate [here](https://appleid.apple.com/account/manage). + +Let's make sure we are able to build our Wails app in our GitHub Action workflow. Here is a small template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +For code signing on macOS, [gon](https://github.com/mitchellh/gon) is a very handy tool for code signing and communicating with Apple servers, also written in Go, and will be used in this guide. + +After the `Build Wails app` step, add the following to the workflow: + +```yaml +- name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon +``` + +Now we need to configure some gon config files in our `build/darwin` directory: + +1. gon-sign.json: + +```json +{ + "source": ["./build/bin/app.app"], + "bundle_id": "app.myapp", + "apple_id": { + "username": "my-appleid@email.com", + "password": "@env:APPLE_PASSWORD" + }, + "sign": { + "application_identity": "Developer ID Application: My Name" + } +} +``` + +Where `source` is your Wails binary, `bundle_id` is your bundle ID, `apple_id` contains your Apple ID username and App-Specific password which you created earlier, and `sign.application_identity` is your identity which you can find by running the following command: + +```bash +security find-identity -v -p codesigning +``` + +2. entitlements.plist: + +```plist + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.downloads.read-write + + + +``` + +In this file you configure the entitlements you need for you app, e.g. camera permissions if your app uses the camera. Read more about entitlements [here](https://developer.apple.com/documentation/bundleresources/entitlements). + +Make sure you have updated your `Info.plist` file with the same bundle ID as you entered in `gon-sign.json`. Here's an example `Info.plist` file: + +```plist + + + CFBundlePackageTypeAPPL + CFBundleNameMyApp + CFBundleExecutableapp + CFBundleIdentifierapp.myapp + CFBundleVersion0.1.0 + CFBundleGetInfoStringMy app is cool and nice and chill and + CFBundleShortVersionString0.1.0 + CFBundleIconFileiconfile + LSMinimumSystemVersion10.13.0 + NSHighResolutionCapabletrue + LSApplicationCategoryTypepublic.app-category.utilities + NSHumanReadableCopyright© Me + +``` + +Now we're ready to add the signing step in our workflow after building the Wails app: + +```yaml +- name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} +- name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json +``` + +Please note that signing binaries with Apple could take anywhere from minutes to hours. + +## Combined workflow file: + +Here is our GitHub workflow file with Windows + macOS combined: + +```yaml +name: "example combined" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon + - name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\Monitor.exe + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +# End notes + +This guide inspired by the RiftShare project and its workflow, which is highly recommended to check out [here](https://github.com/achhabra2/riftshare/blob/main/.github/workflows/build.yaml). diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/templates.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/templates.mdx new file mode 100644 index 00000000..790e3107 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/templates.mdx @@ -0,0 +1,97 @@ +# Templates + +Wails generates projects from pre-created templates. In v1, this was a difficult to maintain set of projects that were subject to going out of date. In v2, to empower the community, a couple of new features have been added for templates: + +- Ability to generate projects from [Remote Templates](../reference/cli.mdx#remote-templates) +- Tooling to help create your own templates + +## Creating Templates + +To create a template, you can use the `wails generate template` command. To generate a default template, run: + +`wails generate template -name mytemplate` + +This creates the directory "mytemplate" with default files: + +```shell title=mytemplate/ +. +|-- NEXTSTEPS.md +|-- README.md +|-- app.tmpl.go +|-- frontend +| `-- dist +| |-- assets +| | |-- fonts +| | | |-- OFL.txt +| | | `-- nunito-v16-latin-regular.woff2 +| | `-- images +| | `-- logo-dark.svg +| |-- index.html +| |-- main.css +| `-- main.js +|-- go.mod.tmpl +|-- main.tmpl.go +|-- template.json +`-- wails.tmpl.json +``` + +### Template Overview + +The default template consists of the following files and directories: + +| Filename / Dir | Description | +| --------------- | -------------------------------------------- | +| NEXTSTEPS.md | Instructions on how to complete the template | +| README.md | The README published with the template | +| app.tmpl.go | `app.go` template file | +| frontend/ | The directory containing frontend assets | +| go.mod.tmpl | `go.mod` template file | +| main.tmpl.go | `main.go` template file | +| template.json | The template metadata | +| wails.tmpl.json | `wails.json` template file | + +At this point it is advisable to follow the steps in `NEXTSTEPS.md`. + +## Creating a Template from an Existing Project + +It's possible to create a template from an existing frontend project by passing the path to the project when generating the template. We will now walk through how to create a Vue 3 template: + +- Install the vue cli: `npm install -g @vue/cli` +- Create the default project: `vue create vue3-base` + - Select `Default (Vue 3) ([Vue 3] babel, eslint)` +- After the project has been generated, run: + +```shell +> wails generate template -name wails-vue3-template -frontend .\vue3-base\ +Extracting base template files... +Migrating existing project files to frontend directory... +Updating package.json data... +Renaming package.json -> package.tmpl.json... +Updating package-lock.json data... +Renaming package-lock.json -> package-lock.tmpl.json... +``` + +- The template may now be customised as specified in the `NEXTSTEPS.md` file +- Once the files are ready, it can be tested by running: `wails init -n my-vue3-project -t .\wails-vue3-template\` +- To test the new project, run: `cd my-vue3-project` then `wails build` +- Once the project has compiled, run it: `.\build\bin\my-vue3-project.exe` +- You should have a fully functioning Vue3 application: + +```mdx-code-block +
+ +
+``` + +## Publishing Templates + +Publishing a template is simply pushing the files to GitHub. The following best practice is encouraged: + +- Remove any unwanted files and directories (such as `.git`) from your frontend directory +- Ensure that `template.json` is complete, especially `helpurl` +- Push the files to GitHub +- Create a PR on the [Community Templates](../community/templates.mdx) page +- Announce the template on the [Template Announcement](https://github.com/wailsapp/wails/discussions/825) discussion board 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 new file mode 100644 index 00000000..7e7081fa --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -0,0 +1,162 @@ +# Troubleshooting + +An assortment of troubleshooting tips. + +## The `wails` command appears to be missing? + +If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. + +## My application is displaying a white/blank screen + +Check that your application includes the assets from the correct directory. In your `main.go` file, you will have something similar to the following code: + +```go +//go:embed all:frontend/dist +var assets embed.FS +``` + +Check that `frontend/dist` contains your application assets. + +### Mac + +If this happens on Mac, try adding the following to your `Info.plist`: + +```xml +NSAppTransportSecurity + + NSAllowsLocalNetworking + + +``` + +Reference: https://github.com/wailsapp/wails/issues/1504#issuecomment-1174317433 + +## Mac application not valid + +If your built application looks like this in finder: + +```mdx-code-block +

+ +

+``` + +it's likely that your application's `info.plist` is invalid. Update the file in `build/.app/Contents/info.plist` and check if the data is valid, EG check the binary name is correct. To persist the changes, copy the file back to the `build/darwin` directory. + +## Cannot call backend method from frontend with variadic arguments + +If you have a backend method defined with variadic parameters, eg: + +```go +func (a *App) TestFunc(msg string, args ...interface{}) error { + // Code +} +``` + +calling this method from the frontend like this will fail: + +```js +var msg = "Hello: "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, ...args) + .then((result) => { + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Workaround: + +```js +var msg = "Hello "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, args) + .then((result) => { + //without the 3 dots + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Credit: https://github.com/wailsapp/wails/issues/1186 + +## I'm having getting proxy errors when trying to install Wails + +If you are getting errors like this: + +``` +"https://proxy.golang.org/github.com/wailsapp/wails/cmd/wails/@v/list": dial tcp 172.217.163.49:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. +``` + +it's probably because the official Go Proxy is being blocked (Users in China have reported this). The solution is to set up the proxy manually, eg: + +``` +go env -w GO111MODULE=on +go env -w GOPROXY=https://goproxy.cn,direct +``` + +Source: https://github.com/wailsapp/wails/issues/1233 + +## The generated Typescript doesn't have the correct types + +Sometimes the generated Typescript doesn't have the correct types. To mitigate this, it is possible to specify what types should be generated using the `ts_type` struct tag. For more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types). + +## When I navigate away from `index.html`, I am unable to call methods on the frontend + +If you navigate away from `index.html` to a new html file, the context will be lost. This can be fixed by adding the following imports to the `` section of any new page you navigate to: + +```html + + + + +``` + +Source: https://github.com/wailsapp/wails/discussions/1512 + +## I get `too many open files` errors on my Mac when I run `wails dev` + +By default, macOS will only allow you to open a maximum of 256 files. This can affect the `wails dev` command. This limit can be increased by running: `ulimit -n 1024` in the terminal. + +FSNotify is [looking to move to Apple's fsevents](https://github.com/fsnotify/fsnotify/issues/11) for Mac. If this isn't completed soon, we will create our own implementation, tracked [here](https://github.com/wailsapp/wails/issues/1733). + +## My Mac app gives me weird compilation errors + +A few users have reported seeing compilation errors such as the following: + +```shell +# github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin +In file included from ../../pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.44.2/internal/frontend/desktop/darwin/callbacks.go:9: +In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12: +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString +- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); + ~~~~~~~~~~~~~~ ^ ~ +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT' + #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A))) +``` + +This is _normally_ due to a mismatch with the OS version you are running and the version of the XCode Command Line Tools installed. If you see an error like this, try upgrading your XCode Command Line Tools to the latest version. + +If reinstalling Xcode Command Tools still fails, you can check the path where the toolkit is located using: + +`xcode-select -p` + +If `/Applications/Xcode.app/Contents/Developer` is displayed, run `sudo xcode-select --switch /Library/Developer/CommandLineTools` + +Sources: https://github.com/wailsapp/wails/issues/1806 and https://github.com/wailsapp/wails/issues/1140#issuecomment-1290446496 + +-- + +## Cannot start service: Host version "x.x.x does not match binary version "x.x.x" + +It's preferable to add `frontend/node_modules` and `frontend/package-lock.json` to your `.gitignore`. Otherwise when opening your repository on another machine that may have different versions of Node installed, you may not be able to run your application. + +If this does happen, simply delete `frontend/node_modules` and `frontend/package-lock.json` and run your `wails build` or `wails dev` command again. \ No newline at end of file diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/vscode.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/vscode.mdx new file mode 100644 index 00000000..ed258656 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/vscode.mdx @@ -0,0 +1,82 @@ + +# Visual Studio Code + +This page is for miscellaneous tips and tricks when using Visual Studio Code with Wails. + +## Vetur Configuration + +Many thanks to [@Lyimmi](https://github.com/Lyimmi) for this tip. Originally posted [here](https://github.com/wailsapp/wails/issues/1791#issuecomment-1228158349). + +Vetur is a popular plugin for Visual Studio Code that provides syntax highlighting and code completion for Vue projects. When loading a Wails project in VSCode, Vetur will throw an error as it is expecting to find the frontend project in the root directory. To fix this, you can do the following: + +Create a file named `vetur.config.js` in the project's root. + +```javascript +// vetur.config.js +/** @type {import('vls').VeturConfig} */ +module.exports = { + // **optional** default: `{}` + // override vscode settings + // Notice: It only affects the settings used by Vetur. + settings: { + "vetur.useWorkspaceDependencies": true, + "vetur.experimental.templateInterpolationService": true + }, + // **optional** default: `[{ root: './' }]` + // support monorepos + projects: [ + { + // **required** + // Where is your project? + // It is relative to `vetur.config.js`. + // root: './packages/repo1', + root: './frontend', + // **optional** default: `'package.json'` + // Where is `package.json` in the project? + // We use it to determine the version of vue. + // It is relative to root property. + package: './package.json', + // **optional** + // Where is TypeScript config file in the project? + // It is relative to root property. + tsconfig: './tsconfig.json', + // **optional** default: `'./.vscode/vetur/snippets'` + // Where is vetur custom snippets folders? + snippetFolder: './.vscode/vetur/snippets', + // **optional** default: `[]` + // Register globally Vue component glob. + // If you set it, you can get completion by that components. + // It is relative to root property. + // Notice: It won't actually do it. You need to use `require.context` or `Vue.component` + globalComponents: [ + './src/components/**/*.vue' + ] + } + ] +} +``` + +Next, configure `frontend/tsconfig.json`: + +```javascript +{ + "compilerOptions": { + "module": "system", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "outFile": "../../built/local/tsc.js", + "allowJs": true + }, + "exclude": [ + "node_modules", + "**/*.spec.ts" + ], + "include": [ + "src/**/*", + "wailsjs/**/*.ts" + ] +} +``` +This should enable you to now use Vetur as expected. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx new file mode 100644 index 00000000..88a1698d --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx @@ -0,0 +1,58 @@ +# NSIS installer + +```mdx-code-block +

+ +
+

+``` + +Wails supports generating Windows installers using the [NSIS installer](https://nsis.sourceforge.io/). + +## Installing NSIS + +### Windows + +The installer is available on the [NSIS Download](https://nsis.sourceforge.io/Download) page. + +If you use the chocolatey package manager, run the following script: + +``` +choco install nsis +``` + +If you install NSIS manually, you need to add the _Bin_ folder, which contains `makensis.exe`, in your NSIS installation to your path. [Here](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) is a good tutorial on how to add to path on Windows. + +### Linux + +The `nsis` package should be available through your distribution's package manager. + +### MacOS + +NSIS is available to install through homebrew: `brew install nsis`. + +## Generating the installer + +When a new project is created, Wails generates the NSIS configuration files in `build/windows/installer`. The config data is read from `installer/info.json` and that is configured to use the project's `wails.json` Info section: + +```json +// ... + "Info": { + "companyName": "My Company Name", + "productName": "Wails Vite", + "productVersion": "1.0.0", + "copyright": "Copyright.........", + "comments": "Built using Wails (https://wails.io)" + }, +``` + +To generate an installer for your application, use the `-nsis` flag with `wails build`: + +``` +wails build -nsis +``` + +The installer will now be available in the `build/bin` directory. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows.mdx new file mode 100644 index 00000000..821808c0 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/windows.mdx @@ -0,0 +1,61 @@ +# Windows + +This page has miscellaneous guides related to developing Wails applications for Windows. + +## Handling the WebView2 Runtime Dependency + +Wails applications built for Windows have a runtime requirement on the Microsoft [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Windows 11 will have this installed by default, but some machines won't. Wails offers an easy approach to dealing with this dependency. + +By using the `-webview2` flag when building, you can decide what your application will do when a suitable runtime is not detected (including if the installed runtime is too old). The four options are: + +1. Download +2. Embed +3. Browser +4. Error + +### Download + +This option will prompt the user that no suitable runtime has been found and then offer to download and run the official bootstrapper from Microsoft's WebView2 site. If the user proceeds, the official bootstrapper will be downloaded and run. + +### Embed + +This option embeds the official bootstrapper within the application. If no suitable runtime has been found, the application will offer to run the bootstrapper. This adds ~150k to the binary size. + +### Browser + +This option will prompt the user that no suitable runtime has been found and then offer to open a browser to the official WebView2 page where the bootstrapper can be downloaded and installed. The application will then exit, leaving the installation up to the user. + +### Error + +If no suitable runtime is found, an error is given to the user and no further action taken. + +## Fixed version runtime + +Another way of dealing with webview2 dependency is shipping it yourself. You can download [fixed version runtime](https://developer.microsoft.com/microsoft-edge/webview2/#download-section) and bundle or download it with your application. + +Also, you should specify path to fixed version of webview2 runtime in the `windows.Options` structure when launching wails. + +```go + wails.Run(&options.App{ + Windows: &windows.Options{ + WebviewBrowserPath: "", + }, + }) +``` + +Note: When `WebviewBrowserPath` is specified, `error` strategy will be forced in case of minimal required version mismatch or invalid path to a runtime. + +## Spawning other programs + +When spawning other programs, such as scripts, you will see the window appear on the screen. To hide the window, you can use the following code: + +```go +cmd := exec.Command("your_script.exe") +cmd.SysProcAttr = &syscall.SysProcAttr{ + HideWindow: true, + CreationFlags: 0x08000000, +} +cmd.Start() +``` + +Solution provided by [sithembiso](https://github.com/sithembiso) on the [discussions board](https://github.com/wailsapp/wails/discussions/1734#discussioncomment-3386172). diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx new file mode 100644 index 00000000..e186de89 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/howdoesitwork.mdx @@ -0,0 +1,369 @@ +--- +sidebar_position: 20 +--- + +# How does it work? + +A Wails application is a standard Go application, with a webkit frontend. The Go part of the application consists of the application code and a runtime library that provides a number of useful operations, like controlling the application window. The frontend is a webkit window that will display the frontend assets. Also available to the frontend is a Javascript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as Javascript methods that can be called, just as if they were local Javascript methods. + +```mdx-code-block +
+ +
+``` + +## The Main Application + +### Overview + +The main application consists of a single call to `wails.Run()`. It accepts the application configuration which describes the size of the application window, the window title, what assets to use, etc. A basic application might look like this: + +```go title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (b *App) startup(ctx context.Context) { + b.ctx = ctx +} + +func (b *App) shutdown(ctx context.Context) {} + +func (b *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +### Options rundown + +This example has the following options set: + +- `Title` - The text that should appear in the window's title bar +- `Width` & `Height` - The dimensions of the window +- `Assets` - The application's frontend assets +- `OnStartup` - A callback for when the window is created and is about to start loading the frontend assets +- `OnShutdown` - A callback for when the application is about to quit +- `Bind` - A slice of struct instances that we wish to expose to the frontend + +A full list of application options can be found in the [Options Reference](reference/options). + +#### Assets + +The `Assets` option is mandatory as you can't have a Wails application without frontend assets. Those assets can be any files you would expect to find in a web application - html, js, css, svg, png, etc. **There is no requirement to generate asset bundles** - plain files will do. When the application starts, it will attempt to load `index.html` from your assets and the frontend will essentially work as a browser from that point on. It is worth noting that there is no requirement on where in the `embed.FS` the files live. It is likely that the embed path uses a nested directory relative to your main application code, such as `frontend/dist`: + +```go title="main.go" +//go:embed all:frontend/dist +var assets embed.FS +``` + +At startup, Wails will iterate the embedded files looking for the directory containing `index.html`. All other assets will be loaded relative to this directory. + +As production binaries use the files contained in `embed.FS`, there are no external files required to be shipped with the application. + +When running in development mode using the `wails dev` command, the assets are loaded off disk, and any changes result in a "live reload". The location of the assets will be inferred from the `embed.FS`. + +More details can be found in the [Application Development Guide](guides/application-development.mdx). + +#### Application Lifecycle Callbacks + +Just before the frontend is about to load `index.html`, a callback is made to the function provided in [OnStartup](reference/options.mdx#onstartup). A standard Go context is passed to this method. This context is required when calling the runtime so a standard pattern is to save a reference to in this method. Just before the application shuts down, the [OnShutdown](reference/options.mdx#onshutdown) callback is called in the same way, again with the context. There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in Javascript. It is also possible to hook into the window close (or application quit) event by setting the option [OnBeforeClose](reference/options.mdx#onbeforeclose). + +#### Method Binding + +The `Bind` option is one of the most important options in a Wails application. It specifies which struct methods to expose to the frontend. Think of structs like "controllers" in a traditional web application. When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate Javascript versions of those methods that can be called by the frontend code. + +:::info Note + +Wails requires that you pass in an _instance_ of the struct for it to bind it correctly + +::: + +In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`: + +```go {16,24} title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`: + +```go {8-10} + //... + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + &mystruct1{}, + &mystruct2{}, + }, + }) + +``` + +When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following: + +- Javascript bindings for all bound methods +- Typescript declarations for all bound methods +- Typescript definitions for all Go structs used as inputs or outputs by the bound methods + +This makes it incredibly simple to call Go code from the frontend, using the same strongly typed datastructures. + +## The Frontend + +### Overview + +The frontend is a collection of files rendered by webkit. It's like a browser and webserver in one. There is virtually[^1] no limit to which frameworks or libraries you can use. The main points of interaction between the frontend and your Go code are: + +- Calling bound Go methods +- Calling runtime methods + +### Calling bound Go methods + +When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). The generated files mirror the package names in your application. In the example above, we bind `app`, which has one public method `Greet`. This will lead to the generation of the following files: + +```bash +wailsjs + └─go + └─main + ├─App.d.ts + └─App.js +``` + +Here we can see that there is a `main` package that contains the Javascript bindings for the bound `App` struct, as well as the Typescript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular Javascript function: + +```javascript +// ... +import { Greet } from "../wailsjs/go/main/App"; + +function doGreeting(name) { + Greet(name).then((result) => { + // Do something with result + }); +} +``` + +The Typescript declaration file gives you the correct types for the bound methods: + +```ts +export function Greet(arg1: string): Promise; +``` + +The generated methods return a Promise. A successful call will result in the first return value from the Go call to be passed to the `resolve` handler. An unsuccessful call is when a Go method that has an error type as it's second return value, passes an error instance back to the caller. This is passed back via the `reject` handler. In the example above, `Greet` only returns a `string` so the Javascript call will never reject - unless invalid data is passed to it. + +All data types are correctly translated between Go and Javascript. Even structs. If you return a struct from a Go call, it will be returned to your frontend as a Javascript class. + +:::info Note + +Struct fields *must* have a valid `json` tag to be included in the generated Typescript. + +Anonymous nested structs are not supported at this time. + +::: + +It is possible to send structs back to Go. Any Javascript map/class passed as an argument that is expecting a struct, will be converted to that struct type. To make this process a lot easier, in `dev` mode, a TypeScript module is generated, defining all the struct types used in bound methods. Using this module, it's possible to construct and send native Javascript objects to the Go code. + +There is also support for Go methods that use structs in their signature. All Go structs specified by a bound method (either as parameters or return types) will have Typescript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and Javascript. + +Example: We update our `Greet` method to accept a `Person` instead of a string: + +```go title="main.go" +type Person struct { + Name string `json:"name"` + Age uint8 `json:"age"` + Address *Address `json:"address"` +} + +type Address struct { + Street string `json:"street"` + Postcode string `json:"postcode"` +} + +func (a *App) Greet(p Person) string { + return fmt.Sprintf("Hello %s (Age: %d)!", p.Name, p.Age) +} +``` + +The `wailsjs/go/main/App.js` file will still have the following code: + +```js title="App.js" +export function Greet(arg1) { + return window["go"]["main"]["App"]["Greet"](arg1); +} +``` + +But the `wailsjs/go/main/App.d.ts` file will be updated with the following code: + +```ts title="App.d.ts" +import { main } from "../models"; + +export function Greet(arg1: main.Person): Promise; +``` + +As we can see, the "main" namespace is imported from a new "models.ts" file. This file contains all the struct definitions used by our bound methods. In this example, this is a `Person` struct. If we look at `models.ts`, we can see how the models are defined: + +```ts title="models.ts" +export namespace main { + export class Address { + street: string; + postcode: string; + + static createFrom(source: any = {}) { + return new Address(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.street = source["street"]; + this.postcode = source["postcode"]; + } + } + export class Person { + name: string; + age: number; + address?: Address; + + static createFrom(source: any = {}) { + return new Person(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.age = source["age"]; + this.address = this.convertValues(source["address"], Address); + } + + convertValues(a: any, classs: any, asMap: boolean = false): any { + if (!a) { + return a; + } + if (a.slice) { + return (a as any[]).map((elem) => this.convertValues(elem, classs)); + } else if ("object" === typeof a) { + if (asMap) { + for (const key of Object.keys(a)) { + a[key] = new classs(a[key]); + } + return a; + } + return new classs(a); + } + return a; + } + } +} +``` + +So long as you have TypeScript as part of your frontend build configuration, you can use these models in the following way: + +```js title="mycode.js" +import { Greet } from "../wailsjs/go/main/App"; +import { main } from "../wailsjs/go/models"; + +function generate() { + let person = new main.Person(); + person.name = "Peter"; + person.age = 27; + Greet(person).then((result) => { + console.log(result); + }); +} +``` + +The combination of generated bindings and TypeScript models makes for a powerful development environment. + +More information on Binding can be found in the [Binding Methods](guides/application-development.mdx#binding-methods) section of the [Application Development Guide](guides/application-development.mdx). + +### Calling runtime methods + +The Javascript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations: + +```js title="mycode.js" +window.runtime.EventsEmit("my-event", 1); +``` + +More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro). + +[^1]: There is a very small subset of libraries that use features unsupported in WebViews. There are often alternatives and workarounds for such cases. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/introduction.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/introduction.mdx new file mode 100644 index 00000000..265f035b --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/introduction.mdx @@ -0,0 +1,75 @@ +--- +sidebar_position: 1 +--- + +# Introduction + +Wails est un projet qui vous permet d'écrire des applications de bureau en utilisant les technologies Go et web. + +Consider it a lightweight and fast Electron alternative for Go. You can easily build applications with the flexibility and power of Go, combined with a rich, modern frontend. + +### Features + +- Native Menus, Dialogs, Theming and Translucency +- Windows, macOS and linux support +- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS +- Easily call Go methods from Javascript +- Automatic Go struct to Typescript model generation +- No CGO or external DLLs required on Windows +- Live development mode using the power of [Vite](https://vitejs.dev/) +- Powerful CLI to easily Create, Build and Package applications +- A rich [runtime library](/docs/reference/runtime/intro) +- Applications built with Wails are Apple & Microsoft Store compliant + +This is [varly](https://varly.app) - a desktop application for MacOS & Windows written using Wails. Not only does it look great, it uses native menus and translucency - everything you'd expect from a modern native app. + +```mdx-code-block +

+ + + +

+``` + +### Quick Start Templates + +Wails comes with a number of pre-configured templates that allow you to get your application up and running quickly. There are templates for the following frameworks: Svelte, React, Vue, Preact, Lit and Vanilla. There are both Javascript and Typescript versions for each template. + +### Native Elements + +Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build good-looking, feature rich desktop applications. + +**It does not embed a browser**, so it is resource efficient. Instead, it uses the native rendering engine for the platform. On Windows, this is the new Microsoft Webview2 library, built on Chromium. + +### Go & Javascript Interoperability + +Wails automatically makes your Go methods available to Javascript, so you can call them by name from your frontend! It even generates Typescript models for the structs used by your Go methods, so you can pass the same data structures between Go and Javascript. + +### Runtime Library + +Wails provides a runtime library, for both Go and Javascript, that handles a lot of the things modern applications need, like Eventing, Logging, Dialogs, etc. + +### Live Development Experience + +#### Automatic Rebuilds + +When you run your application in "dev" mode, Wails will build your application as a native desktop application, but will read your assets from disk. It will detect any changes to your Go code and automatically rebuild and relaunch your application. + +#### Automatic Reloads + +When changes to your application assets are detected, your running application will "reload", reflecting your changes almost immediately. + +#### Develop your application in a Browser + +If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver that will run your application in any browser that connects to it. It will even refresh when your assets change on disk. + +### Production-ready Native Binaries + +When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving you total control over how your applications are built. + +### Tooling + +The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting of creating icons, compiling your application with optimal settings and delivering a distributable, production ready binary. Choose from a number of starter templates to get up and running quickly! 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 new file mode 100644 index 00000000..36f6c971 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -0,0 +1,229 @@ +--- +sidebar_position: 2 +--- + +# CLI + +The Wails CLI has a number of commands that are used for managing your projects. All commands are run in the following way: + +`wails ` + +## init + +`wails init` is used for generating projects. + +| Flag | Description | Default | +|:------------------ |:----------------------------------------------------------------------------------------------------------------------- |:-------------------:| +| -n "project name" | Name of the project. **Mandatory**. | | +| -d "project dir" | Project directory to create | Name of the project | +| -g | Initialise git repository | | +| -l | List available project templates | | +| -q | Suppress output to console | | +| -t "template name" | The project template to use. This can be the name of a default template or a URL to a remote template hosted on github. | vanilla | +| -ide | Generate IDE project files | | +| -f | Force build application | false | + +Example: `wails init -n test -d mytestproject -g -ide vscode -q` + +This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently. + +More information on using IDEs with Wails can be found [here](../guides/ides.mdx). + +### Remote Templates + +Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL. + +Example: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]` + +A list of community maintained templates can be found [here](../community/templates.mdx) + +:::warning Attention + +**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!** + +If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed. + +::: + +## build + +`wails build` is used for compiling your project to a production-ready binary. + +| Flag | Description | Default | +|:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | +| -platform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platforms) eg. `windows/arm64`. Note, if you do not give the architecture, `runtime.GOARCH` is used. | platform = `GOOS` environment variable if given else `runtime.GOOS`.
arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. | +| -clean | Cleans the `build/bin` directory | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -nopackage | Do not package application | | +| -o filename | Output filename | | +| -s | Skip building the frontend | false | +| -f | Force build application | false | +| -tags "extra tags" | Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated | | +| -upx | Compress final binary using "upx" | | +| -upxflags | Flags to pass to upx | | +| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 | +| -webview2 | WebView2 installer strategy: download,embed,browser,error | download | +| -u | Updates your project's `go.mod` to use the same version of Wails as the CLI | | +| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | false | +| -trimpath | Remove all file system paths from the resulting executable. | false | +| -race | Build with Go's race detector | false | +| -windowsconsole | Keep the console window for Windows builds | | +| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false | +| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` | + +For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide. + +If you prefer to build using standard Go tooling, please consult the [Manual Builds](../guides/manual-builds.mdx) guide. + +Example: + +`wails build -clean -o myproject.exe` + +:::Info +On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +::: + +:::info UPX on Apple Silicon + +There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon. + +::: + +:::info UPX on Windows + +Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437). + +::: + +### Platforms + +Supported platforms are: + +| Platform | Description | +|:---------------- |:--------------------------------------------- | +| darwin | MacOS + architecture of build machine | +| darwin/amd64 | MacOS 10.13+ AMD64 | +| darwin/arm64 | MacOS 11.0+ ARM64 | +| darwin/universal | MacOS AMD64+ARM64 universal application | +| windows | Windows 10/11 + architecture of build machine | +| windows/amd64 | Windows 10/11 AMD64 | +| windows/arm64 | Windows 10/11 ARM64 | +| linux | Linux + architecture of build machine | +| linux/amd64 | Linux AMD64 | +| linux/arm64 | Linux ARM64 | + +## doctor + +`wails doctor` will run diagnostics to ensure that your system is ready for development. + +Example: + +``` +Wails CLI v2.0.0-beta + +Scanning system - Please wait (this may take a long time)...Done. + +System +------ +OS: Windows 10 Pro +Version: 2009 (Build: 19043) +ID: 21H1 +Go Version: go1.18 +Platform: windows +Architecture: amd64 + +Dependency Package Name Status Version +---------- ------------ ------ ------- +WebView2 N/A Installed 93.0.961.52 +npm N/A Installed 6.14.15 +*upx N/A Installed upx 3.96 + +* - Optional Dependency + +Diagnosis +--------- +Your system is ready for Wails development! + +``` + +## dev + +`wails dev` is used to run your application in a "live development" mode. This means: + +- The application's `go.mod` will be updated to use the same version of Wails as the CLI +- The application is compiled and run automatically +- A watcher is started and will trigger a rebuild of your dev app if it detects changes to your go files +- A webserver is started on `http://localhost:34115` which serves your application (not just frontend) over http. This allows you to use your favourite browser development extensions +- All application assets are loaded from disk. If they are changed, the application will automatically reload (not rebuild). All connected browsers will also reload +- 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. + +| Flag | Description | Default | +|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- | +| -assetdir "./path/to/assets" | Serve assets from the given directory instead of using the provided asset FS | Value in `wails.json` | +| -browser | Opens a browser to `http://localhost:34115` on startup | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -e | Extensions to trigger rebuilds (comma separated) | go | +| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | | +| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | Debug | +| -noreload | Disable automatic reload when assets change | | +| -nocolour | Turn off colour cli output | false | +| -nogen | Disable generate module | | +| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 | +| -wailsjsdir | The directory to generate the generated Wails JS modules | Value in `wails.json` | +| -debounce | The time to wait for reload after an asset change is detected | 100 (milliseconds) | +| -devserver "host:port" | The address to bind the wails dev server to | "localhost:34115" | +| -frontenddevserverurl "url" | Use 3rd party dev server url to serve assets, EG Vite | "" | +| -appargs "args" | Arguments passed to the application in shell style | | +| -save | Saves the given `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` flags in `wails.json` to become the defaults for subsequent invocations. | | +| -race | Build with Go's race detector | false | +| -s | Skip building the frontend | false | + +Example: + +`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser` + +This command will do the following: + +- Build the application and run it (more details [here](../guides/manual-builds.mdx) +- Generate the Wails JS modules in `./frontend/src` +- Watch for updates to files in `./frontend/dist` and reload on any change +- Open a browser and connect to the application + +There is more information on using this feature with existing framework scripts [here](../guides/application-development.mdx#live-reloading). + +## generate + +### template + +Wails uses templates for project generation. The `wails generate template` command helps scaffold a template so that it may be used for generating projects. + +| Flag | Description | +|:---------------- |:------------------------------------------- | +| -name | The template name (Mandatory) | +| -frontend "path" | Path to frontend project to use in template | + +For more details on creating templates, consult the [Templates guide](../guides/templates.mdx). + +### module + +The `wails generate module` command allows you to manually generate the `wailsjs` directory for your application. + +## update + +`wails update` will update the version of the Wails CLI. + +| Flag | Description | +|:------------------ |:------------------------------------- | +| -pre | Update to latest pre-release version | +| -version "version" | Install a specific version of the CLI | + +## version + +`wails version` will simply output the current CLI version. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx new file mode 100644 index 00000000..304f57d6 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/menus.mdx @@ -0,0 +1,227 @@ +--- +sidebar_position: 4 +--- + +# Menus + +It is possible to add an application menu to Wails projects. This is achieved by defining a [Menu](#menu) struct and setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu). + +An example of how to create a menu: + +```go + AppMenu := menu.NewMenu() + FileMenu := AppMenu.AddSubmenu("File") + FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile) + FileMenu.AddSeparator() + FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) { + runtime.Quit() + }) + + if runtime.GOOS == "darwin" { + AppMenu.Append(menu.EditMenu()) // on macos platform, we should append EditMenu to enable Cmd+C,Cmd+V,Cmd+Z... shortcut + } + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + Menu: AppMenu, + Bind: []interface{}{ + app, + }, + ) + // ... +``` + +It is also possible to dynamically update the menu, by updating the menu struct and calling [MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu). + +The example above uses helper methods, however it's possible to build the menu structs manually. + +## Menu + +A Menu is a collection of MenuItems: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Menu struct { + Items []*MenuItem +} +``` + +For the Application menu, each MenuItem represents a single menu such as "Edit". + +A simple helper method is provided for building menus: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func NewMenuFromItems(first *MenuItem, rest ...*MenuItem) *Menu +``` + +This makes the layout of the code more like that of a menu without the need to add the menu items manually after creating them. Alternatively, you can just create the menu items and add them to the menu manually. + +## MenuItem + +A MenuItem represents an item within a Menu. + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +// MenuItem represents a menu item contained in a menu +type MenuItem struct { + Label string + Role Role + Accelerator *keys.Accelerator + Type Type + Disabled bool + Hidden bool + Checked bool + SubMenu *Menu + Click Callback +} +``` + +| Field | Type | Notes | +| ----------- | ------------------------------------ | ------------------------------------------------------------- | +| Label | string | The menu text | +| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item | +| Type | [Type](#type) | Type of MenuItem | +| Disabled | bool | Disables the menu item | +| Hidden | bool | Hides this menu item | +| Checked | bool | Adds check to item (Checkbox & Radio types) | +| SubMenu | [\*Menu](#menu) | Sets the submenu | +| Click | [Callback](#callback) | Callback function when menu clicked | +| Role | string | Defines a [role](#role) for this menu item. Mac only for now. | + +### Accelerator + +Accelerators (sometimes called keyboard shortcuts) define a binding between a keystroke and a menu item. Wails defines an Accelerator as a combination or key + [Modifier](#modifier). They are available in the `"github.com/wailsapp/wails/v2/pkg/menu/keys"` package. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut := keys.CmdOrCtrl("o") +``` + +Keys are any single character on a keyboard with the exception of `+`, which is defined as `plus`. Some keys cannot be represented as characters so there are a set of named characters that may be used: + +| | | | | +|:-----------:|:-----:|:-----:|:---------:| +| `backspace` | `f1` | `f16` | `f31` | +| `tab` | `f2` | `f17` | `f32` | +| `return` | `f3` | `f18` | `f33` | +| `enter` | `f4` | `f19` | `f34` | +| `escape` | `f5` | `f20` | `f35` | +| `left` | `f6` | `f21` | `numlock` | +| `right` | `f7` | `f22` | | +| `up` | `f8` | `f23` | | +| `down` | `f9` | `f24` | | +| `space` | `f10` | `f25` | | +| `delete` | `f11` | `f36` | | +| `home` | `f12` | `f37` | | +| `end` | `f13` | `f38` | | +| `page up` | `f14` | `f39` | | +| `page down` | `f15` | `f30` | | + +Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut, err := keys.Parse("Ctrl+Option+A") +``` + +#### Modifier + +The following modifiers are keys that may be used in combination with the accelerator key: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +const ( + // CmdOrCtrlKey represents Command on Mac and Control on other platforms + CmdOrCtrlKey Modifier = "cmdorctrl" + // OptionOrAltKey represents Option on Mac and Alt on other platforms + OptionOrAltKey Modifier = "optionoralt" + // ShiftKey represents the shift key on all systems + ShiftKey Modifier = "shift" + // ControlKey represents the control key on all systems + ControlKey Modifier = "ctrl" +) +``` + +A number of helper methods are available to create Accelerators using modifiers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +func CmdOrCtrl(key string) *Accelerator +func OptionOrAlt(key string) *Accelerator +func Shift(key string) *Accelerator +func Control(key string) *Accelerator +``` + +Modifiers can be combined using `keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines "Ctrl+Option+A" on Mac and "Ctrl+Alt+A" on Window/Linux + myShortcut := keys.Combo("a", ControlKey, OptionOrAltKey) +``` + +### Type + +Each menu item must have a type and there are 5 types available: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +const ( + TextType Type = "Text" + SeparatorType Type = "Separator" + SubmenuType Type = "Submenu" + CheckboxType Type = "Checkbox" + RadioType Type = "Radio" +) +``` + +For convenience, helper methods are provided to quickly create a menu item: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func Text(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func Separator() *MenuItem +func Radio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func Checkbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func SubMenu(label string, menu *Menu) *Menu +``` + +You can also create menu items directly on a menu by using the "Add" helpers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func (m *Menu) AddText(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSeparator() *MenuItem +func (m *Menu) AddRadio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddCheckbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSubMenu(label string, menu *Menu) *MenuI +``` + +A note on radio groups: A radio group is defined as a number of radio menu items that are next to each other in the menu. This means that you do not need to group items together as it is automatic. However, that also means you cannot have 2 radio groups next to each other - there must be a non-radio item between them. + +### Callback + +Each menu item may have a callback that is executed when the item is clicked: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Callback func(*CallbackData) + +type CallbackData struct { + MenuItem *MenuItem +} +``` + +The function is given a `CallbackData` struct which indicates which menu item triggered the callback. This is useful when using radio groups that may share a callback. + +### Role + +:::info Roles + +Roles are currently supported on Mac only. + +::: + +A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles: + +| Role | Description | +| ------------ | ------------------------------------------------------------------------ | +| AppMenuRole | The standard Mac application menu. Can be created using `menu.AppMenu()` | +| EditMenuRole | The standard Mac edit menu. Can be created using `menu.EditMenu()` | 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 new file mode 100644 index 00000000..a42d4442 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -0,0 +1,736 @@ +--- +sidebar_position: 3 +--- + +# Options + +## Application Options + +The `Options.App` struct contains the application configuration. It is passed to the `wails.Run()` method: + +```go title="Example" +import ( + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "github.com/wailsapp/wails/v2/pkg/options/linux" + "github.com/wailsapp/wails/v2/pkg/options/mac" + "github.com/wailsapp/wails/v2/pkg/options/windows" +) + +func main() { + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + DisableResize: false, + Fullscreen: false, + WindowStartState: options.Maximised, + Frameless: true, + MinWidth: 400, + MinHeight: 400, + MaxWidth: 1280, + MaxHeight: 1024, + StartHidden: false, + HideWindowOnClose: false, + BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255}, + AlwaysOnTop: false, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: assetsHandler, + Middleware: assetsMidldeware, + }, + Menu: app.applicationMenu(), + Logger: nil, + LogLevel: logger.DEBUG, + LogLevelProduction: logger.ERROR, + OnStartup: app.startup, + OnDomReady: app.domready, + OnShutdown: app.shutdown, + OnBeforeClose: app.beforeClose, + CSSDragProperty: "--wails-draggable", + CSSDragValue: "drag", + ZoomFactor: 1.0, + IsZoomControlEnabled: false, + Bind: []interface{}{ + app, + }, + Windows: &windows.Options{ + WebviewIsTransparent: false, + WindowIsTranslucent: false, + BackdropType: windows.Mica, + DisableWindowIcon: false, + DisableFramelessWindowDecorations: false, + WebviewUserDataPath: "", + WebviewBrowserPath: "", + Theme: windows.SystemDefault, + CustomTheme: &windows.ThemeSettings{ + DarkModeTitleBar: windows.RGB(20, 20, 20), + DarkModeTitleText: windows.RGB(200, 200, 200), + DarkModeBorder: windows.RGB(20, 0, 20), + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + }, + // User messages that can be customised + Messages *windows.Messages + // OnSuspend is called when Windows enters low power mode + OnSuspend func() + // OnResume is called when Windows resumes from low power mode + OnResume func() + }, + Mac: &mac.Options{ + TitleBar: &mac.TitleBar{ + TitlebarAppearsTransparent: true, + HideTitle: false, + HideTitleBar: false, + FullSizeContent: false, + UseToolbar: false, + HideToolbarSeparator: true, + }, + Appearance: mac.NSAppearanceNameDarkAqua, + WebviewIsTransparent: true, + WindowIsTranslucent: false, + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + Linux: &linux.Options{ + Icon: icon, + WindowIsTranslucent: false, + }, + Debug: options.Debug{ + OpenInspectorOnStartup: false, + }, + }) + + if err != nil { + log.Fatal(err) + } +} + +``` + +### Title + +The text shown in the window's title bar. + +Name: Title
Type: `string` + +### Width + +The initial width of the window. + +Name: Width
Type: `int`
Default: 1024. + +### Height + +The initial height of the window. + +Name: Height
Type: `int`
Default: 768 + +### DisableResize + +By default, the main window is resizable. Setting this to `true` will keep it a fixed size. + +Name: DisableResize
Type: `bool` + +### Fullscreen + +Deprecated: Please use [WindowStartState](#windowstartstate). + +### WindowStartState + +Defines how the window should present itself at startup. + +| Value | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +Name: WindowStartState
Type: `options.WindowStartState` + +### Frameless + +When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx). + +Name: Frameless
Type: `bool` + +### MinWidth + +This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default. + +Name: MinWidth
Type: `int` + +### MinHeight + +This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default. + +Name: MinHeight
Type: `int` + +### MaxWidth + +This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default. + +Name: MaxWidth
Type: `int` + +### MaxHeight + +This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default. + +Name: MaxHeight
Type: `int` + +### StartHidden + +When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called. + +Name: StartHidden
Type: `bool` + +### HideWindowOnClose + +By default, closing the window will close the application. Setting this to `true` means closing the window will + +hide the window instead. + +Name: HideWindowOnClose
Type: `bool` + +### BackgroundColour + +This value is the default background colour of the window. Example: options.NewRGBA(255,0,0,128) - Red at 50% transparency + +Name: BackgroundColour
Type: `*options.RGBA`
Default: white + +### AlwaysOnTop + +Indicates that the window should stay above other windows when losing focus. + +Name: AlwaysOnTop
Type: `bool` + +### Assets + +Deprecated: Please use Assets on [AssetServer specific options](#assetserver). + +### AssetsHandler + +Deprecated: Please use AssetsHandler on [AssetServer specific options](#assetserver). + +### AssetServer + +This defines AssetServer specific options. It allows to customize the AssetServer with static assets, serving assets dynamically with an `http.Handler` or hook into the request chain with an `assetserver.Middleware`. + +Not all features of an `http.Request` are currently supported, please see the following feature matrix: + +| Feature | Win | Mac | Lin | +| ----------------------- | --- | --- | --- | +| GET | ✅ | ✅ | ✅ | +| POST | ✅ | ✅ | ❌ | +| PUT | ✅ | ✅ | ❌ | +| PATCH | ✅ | ✅ | ❌ | +| DELETE | ✅ | ✅ | ❌ | +| Request Headers | ✅ | ✅ | ❌ | +| Request Body | ✅ | ✅ | ❌ | +| Request Body Streaming | ❌ | ❌ | ❌ | +| Response StatusCodes | ✅ | ✅ | ❌ | +| Response Headers | ✅ | ✅ | ❌ | +| Response Body | ✅ | ✅ | ✅ | +| Response Body Streaming | ❌ | ❌ | ✅ | +| WebSockets | ❌ | ❌ | ❌ | + +NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support. + +Name: AssetServer
Type: `*assetserver.Options` + +#### Assets + +The static frontend assets to be used by the application. + +A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. + +If set to nil, all GET requests will be forwarded to [Handler](#handler). + +Name: Assets
Type: `fs.FS` + +#### Handler + +The assets handler is a generic `http.Handler` for fallback handling of assets that can't be found. + +The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. If not defined, the result is the following in cases where the Handler would have been called: + +- GET request: `http.StatusNotFound` +- Other request: `http.StatusMethodNotAllowed` + +NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension. + +Name: AssetsHandler
Type: `http.Handler` + +#### Middleware + +Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default request handler dynamically, e.g. implement specialized Routing etc. The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default handler used by the AssetServer as an argument. + +If not defined, the default AssetServer request chain is executed. + +Name: Middleware
Type: `assetserver.Middleware` + +### Menu + +The menu to be used by the application. More details about Menus in the [Menu Reference](../reference/runtime/menu.mdx). + +:::note + +On Mac, if no menu is specified, a default menu will be created. + +::: + +Name: Menu
Type: `*menu.Menu` + +### Logger + +The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: Logger
Type: `logger.Logger`
Default: Logs to Stdout + +### LogLevel + +The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevel
Type: `logger.LogLevel`
Default: `Info` in dev mode, `Error` in production mode + +### LogLevelProduction + +The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevelProduction
Type: `logger.LogLevel`
Default: `Error` + +### OnStartup + +This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context. + +Name: OnStartup
Type: `func(ctx context.Context)` + +### OnDomReady + +This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context. + +Name: OnDomReady
Type: `func(ctx context.Context)` + +### OnShutdown + +This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context. + +Name: OnShutdown
Type: `func(ctx context.Context)` + +### OnBeforeClose + +If this callback is set, it will be called when the application is about to quit, either by clicking the window close button or calling `runtime.Quit`. Returning true will cause the application to continue, false will continue shutdown as normal. This is good for confirming with the user that they wish to exit the program. + +Example: + +```go title=windowsapp.go +func (b *App) beforeClose(ctx context.Context) (prevent bool) { + dialog, err := runtime.MessageDialog(ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Quit?", + Message: "Are you sure you want to quit?", + }) + + if err != nil { + return false + } + return dialog != "Yes" +} +``` + +Name: OnBeforeClose
Type: `func(ctx context.Context) bool` + +### CSSDragProperty + +Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`. + +Name: CSSDragProperty
Type: `string` + +### CSSDragValue + +Indicates what value the `CSSDragProperty` style should have to drag the window. Default: `drag`. + +Name: CSSDragValue
Type: `string` + +### ZoomFactor + +Name: ZoomFactor
Type: `float64` + +This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. + +### IsZoomControlEnabled + +Name: IsZoomControlEnabled
Type: `bool` + +This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar). + +### Bind + +A slice of struct instances defining methods that need to be bound to the frontend. + +Name: Bind
Type: `[]interface{}` + +### Windows + +This defines [Windows specific options](#windows). + +Name: Windows
Type: `*windows.Options` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent). + +For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw) method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the newer translucency types that are much faster. By default, the type of translucency used will be determined by Windows. To configure this, use the [BackdropType](#BackdropType) option. + +Name: WindowIsTranslucent
Type: `bool` + +#### BackdropType + +:::note + +Requires Windows 11 build 22621 or later. + +::: + +Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`. + +Name: BackdropType
Type `windows.BackdropType` + +The value can be one of the following: + +| Value | Description | +| ------- | ----------------------------------------------------------------------------------------- | +| Auto | Let Windows decide which backdrop to use | +| None | Do not use translucency | +| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect | +| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect | +| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | + +#### DisableWindowIcon + +Setting this to `true` will remove the icon in the top left corner of the title bar. + +Name: DisableWindowIcon
Type: `bool` + +#### DisableFramelessWindowDecorations + +Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11. + +Name: DisableFramelessWindowDecorations
Type: `bool` + +#### WebviewUserDataPath + +This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used. + +Name: WebviewUserDataPath
Type: `string` + +#### WebviewBrowserPath + +This defines the path to a directory with WebView2 executable files and libraries. If empty, webview2 installed in the system will be used. + +Important information about distribution of fixed version runtime: + +- [How to get and extract runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode) +- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version) +- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions) + +Name: WebviewBrowserPath
Type: `string` + +#### Theme + +Minimum Windows Version: Windows 10 2004/20H1 + +This defines the theme that the application should use: + +| Value | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| SystemDefault | _Default_. The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting | +| Dark | The application will use a dark theme exclusively | +| Light | The application will use a light theme exclusively | + +Name: Theme
Type: `windows.Theme` + +#### CustomTheme + +:::note + +Minimum Windows Version: Windows 10/11 2009/21H2 Build 22000 + +::: + +Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive. + +Name: CustomTheme
Type: `windows.CustomTheme` + +##### CustomTheme type + +The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`. + +NOTE: Any value not provided will default to black. + +```go +type ThemeSettings struct { + DarkModeTitleBar int32 + DarkModeTitleBarInactive int32 + DarkModeTitleText int32 + DarkModeTitleTextInactive int32 + DarkModeBorder int32 + DarkModeBorderInactive int32 + LightModeTitleBar int32 + LightModeTitleBarInactive int32 + LightModeTitleText int32 + LightModeTitleTextInactive int32 + LightModeBorder int32 + LightModeBorderInactive int32 +} +``` + +Example: + +```go + CustomTheme: &windows.ThemeSettings{ + // Theme to use when window is active + DarkModeTitleBar: windows.RGB(255, 0, 0), // Red + DarkModeTitleText: windows.RGB(0, 255, 0), // Green + DarkModeBorder: windows.RGB(0, 0, 255), // Blue + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + // Theme to use when window is inactive + DarkModeTitleBarInactive: windows.RGB(128, 0, 0), + DarkModeTitleTextInactive: windows.RGB(0, 128, 0), + DarkModeBorderInactive: windows.RGB(0, 0, 128), + LightModeTitleBarInactive: windows.RGB(100, 100, 100), + LightModeTitleTextInactive: windows.RGB(10, 10, 10), + LightModeBorderInactive: windows.RGB(100, 100, 100), + }, +``` + +#### Messages + +A struct of strings used by the webview2 installer if a valid webview2 runtime is not found. + +Name: Messages
Type: `*windows.Messages` + +Customise this for any language you choose to support. + +#### ResizeDebounceMS + +ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can. + +Name: ResizeDebounceMS
Type: `uint16` + +#### OnSuspend + +If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate) + +Name: OnSuspend
Type: `func()` + +#### OnResume + +If set, this function will be called when Windows resumes from low power mode (suspend/hibernate) + +Name: OnResume
Type: `func()` + +### Mac + +This defines [Mac specific options](#mac). + +Name: Mac
Type: `*mac.Options` + +#### TitleBar + +The TitleBar struct provides the ability to configure the look and feel of the title bar. + +Name: TitleBar
Type: [`*mac.TitleBar`](#titlebar-struct) + +##### Titlebar struct + +The titlebar of the application can be customised by using the TitleBar options: + +```go +type TitleBar struct { + TitlebarAppearsTransparent bool + HideTitle bool + HideTitleBar bool + FullSizeContent bool + UseToolbar bool + HideToolbarSeparator bool +} +``` + +| Name | Description | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| TitlebarAppearsTransparent | Makes the titlebar transparent. This has the effect of hiding the titlebar and the content fill the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc) | +| HideTitle | Hides the title of the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc) | +| HideTitleBar | Removes [NSWindowStyleMaskTitled](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktitled/) from the style mask | +| FullSizeContent | Makes the webview fill the entire window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemaskfullsizecontentview) | +| UseToolbar | Adds a default toolbar to the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar?language=objc) | +| HideToolbarSeparator | Removes the line beneath the toolbar. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar/1516954-showsbaselineseparator?language=objc) | + +Preconfigured titlebar settings are available: + +| Setting | Example | +| --------------------------- | ---------------------------------------------- | +| `mac.TitleBarDefault()` | ![](/img/reference/titlebar-default.webp) | +| `mac.TitleBarHidden()` | ![](/img/reference/titlebar-hidden.webp) | +| `mac.TitleBarHiddenInset()` | ![](/img/reference/titlebar-hidden-inset.webp) | + +Example: + +```go +Mac: &mac.Options{ + TitleBar: mac.TitleBarHiddenInset(), +} +``` + +Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on customising the titlebar. + +#### Appearance + +Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names. + +Name: Appearance
Type: [`mac.AppearanceType`](#appearance-type) + +##### Appearance type + +You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc). + +| Value | Description | +| ----------------------------------------------------- | --------------------------------------------------------------- | +| DefaultAppearance | DefaultAppearance uses the default system value | +| NSAppearanceNameAqua | The standard light system appearance | +| NSAppearanceNameDarkAqua | The standard dark system appearance | +| NSAppearanceNameVibrantLight | The light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastAqua | A high-contrast version of the standard light system appearance | +| NSAppearanceNameAccessibilityHighContrastDarkAqua | A high-contrast version of the standard dark system appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantLight | A high-contrast version of the light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantDark | A high-contrast version of the dark vibrant appearance | + +Example: + +```go +Mac: &mac.Options{ + Appearance: mac.NSAppearanceNameDarkAqua, +} +``` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications. + +Name: WindowIsTranslucent
Type: `bool` + +#### About + +This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role. + +Name: About
Type: [`*mac.AboutInfo`](#about-struct) + +##### About struct + +```go + +type AboutInfo struct { + Title string + Message string + Icon []byte +} +``` + +If these settings are provided, an "About" menu item will appear in the app menu (when using the `AppMenu` role). Given this configuration: + +```go +//go:embed build/appicon.png +var icon []byte + +func main() { + err := wails.Run(&options.App{ + ... + Mac: &mac.Options{ + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + }) +``` + +The "About" menu item will appear in the app menu: + +```mdx-code-block +
+ +
+
+``` + +When clicked, that will open an about message box: + +```mdx-code-block +
+ +
+
+``` + +### Linux + +This defines [Linux specific options](#linux). + +Name: Linux
Type: `*linux.Options` + +#### Icon + +Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified). + +Name: Icon
Type: `[]byte` + +Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. + +NOTE: Gnome on Wayland at least does not display this icon. To have a application icon there, a `.desktop` file has to be used. On KDE it should work. + +The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality. + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window. + +Name: WindowIsTranslucent
Type: `bool` + +### Debug + +This defines [Debug specific options](#Debug) that apply to debug builds. + +Name: Debug
Type: `options.Debug` + +#### OpenInspectorOnStartup + +Setting this to `true` will open the WebInspector on startup of the application. + +Name: OpenInspectorOnStartup
Type: `bool` 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 new file mode 100644 index 00000000..f573a4ad --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -0,0 +1,57 @@ +--- +sidebar_position: 5 +--- + +# Project Config + +The project config resides in the `wails.json` file in the project directory. The structure of the config is: + +```json +{ + "name": "[The project name]", + "assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]", + "reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]", + "build:dir": "[The directory where the build files reside. Defaults to 'build']", + "frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']", + "frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]", + "frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]", + "frontend:dev": "[This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build]", + "frontend:dev:build": "[This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev]", + "frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]", + "frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]", + "frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output]", + "wailsjsdir": "[Relative path to the directory that the auto-generated JS modules will be created]", + "version": "[Project config version]", + "outputfilename": "[The name of the binary]", + "debounceMS": 100, // The default time the dev server waits to reload when it detects a change in assets + "devServer": "[Address to bind the wails dev sever to. Default: localhost:34115]", + "appargs": "[Arguments passed to the application in shell style when in dev mode]", + "runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS. + "preBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]" + }, + "postBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]" + }, + "info": { // Data used to populate manifests and version info. + "companyName": "[The company name. Default: [The project name]]", + "productName": "[The product name. Default: [The project name]]", + "productVersion": "[The version of the product. Default: '1.0.0']", + "copyright": "[The copyright of the product. Default: 'Copyright.........']", + "comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']" + }, + "nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple']", + "obfuscated": "[Whether the app should be obfuscated. Default: false]", + "garbleargs": "[The arguments to pass to the garble command when using the obfuscated flag]" +} +``` + +This file is read by the Wails CLI when running `wails build` or `wails dev`. + +The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs. + +The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json). diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx new file mode 100644 index 00000000..c71ec4a3 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +--- + +# Browser + +These methods are related to the system browser. + +### BrowserOpenURL + +Opens the given URL in the system browser. + +Go: `BrowserOpenURL(ctx context.Context, url string)`
JS: `BrowserOpenURL(url string)` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx new file mode 100644 index 00000000..cf7bf37b --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx @@ -0,0 +1,302 @@ +--- +sidebar_position: 5 +--- + +# Dialog + +This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes. + +:::info Javascript + +Dialog is currently unsupported in the JS runtime. + +::: + +### OpenDirectoryDialog + +Opens a dialog that prompts the user to select a directory. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected directory (blank if the user cancelled) or an error + +### OpenFileDialog + +Opens a dialog that prompts the user to select a file. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected file (blank if the user cancelled) or an error + +### OpenMultipleFilesDialog + +Opens a dialog that prompts the user to select multiple files. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)` + +Returns: Selected files (nil if the user cancelled) or an error + +### SaveFileDialog + +Opens a dialog that prompts the user to select a filename for the purposes of saving. Can be customised using [SaveDialogOptions](#savedialogoptions). + +Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)` + +Returns: The selected file (blank if the user cancelled) or an error + +### MessageDialog + +Displays a message using a message dialog. Can be customised using [MessageDialogOptions](#messagedialogoptions). + +Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)` + +Returns: The text of the selected button or an error + +## Options + +### OpenDialogOptions + +```go +type OpenDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + ResolvesAliases bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| ResolvesAliases | If true, returns the file not the alias | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### SaveDialogOptions + +```go +type SaveDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### MessageDialogOptions + +```go +type MessageDialogOptions struct { + Type DialogType + Title string + Message string + Buttons []string + DefaultButton string + CancelButton string +} +``` + +| Field | Description | Win | Mac | Lin | +| ------------- | -------------------------------------------------------------------------- | -------------- | --- | --- | +| Type | The type of message dialog, eg question, info... | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| Message | The message to show the user | ✅ | ✅ | ✅ | +| Buttons | A list of button titles | | ✅ | | +| DefaultButton | The button with this text should be treated as default. Bound to `return`. | ✅[*](#windows) | ✅ | | +| CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | | + +#### Windows + +Windows has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue". + +For Question dialogs, the default button is "Yes" and the cancel button is "No". This can be changed by setting the `DefaultButton` value to `"No"`. + +Example: +```go + result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Question", + Message: "Do you want to continue?", + DefaultButton: "No", + }) +``` + +#### Linux + +Linux has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Yes", "No" + +#### Mac + +A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button is considered default and is bound to the `return` key. + +For the following code: + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, +}) +``` + +the first button is shown as default: + +```mdx-code-block +
+ +
+
+``` + +And if we specify `DefaultButton` to be "two": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", +}) +``` + +the second button is shown as default. When `return` is pressed, the value "two" is returned. + +```mdx-code-block +
+ +
+
+``` + +If we now specify `CancelButton` to be "three": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", + CancelButton: "three", +}) +``` + +the button with "three" is shown at the bottom of the dialog. When `escape` is pressed, the value "three" is returned: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### DialogType + +```go +const ( + InfoDialog DialogType = "info" + WarningDialog DialogType = "warning" + ErrorDialog DialogType = "error" + QuestionDialog DialogType = "question" + ) +``` + +### FileFilter + +```go +type FileFilter struct { + DisplayName string // Filter information EG: "Image Files (*.jpg, *.png)" + Pattern string // semi-colon separated list of extensions, EG: "*.jpg;*.png" +} +``` + +#### Windows + +Windows allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Linux + +Linux allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Mac + +Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided, Wails will use all the Patterns defined. + +Example: + +```go + selection, err := runtime.OpenFileDialog(b.ctx, runtime.OpenDialogOptions{ + Title: "Select File", + Filters: []runtime.FileFilter{ + { + DisplayName: "Images (*.png;*.jpg)", + Pattern: "*.png;*.jpg", + }, { + DisplayName: "Videos (*.mov;*.mp4)", + Pattern: "*.mov;*.mp4", + }, + }, + }) +``` + +This will result in the Open File dialog using `*.png,*.jpg,*.mov,*.mp4` as a filter. diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx new file mode 100644 index 00000000..373a65d7 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# Events + +The Wails runtime provides a unified events system, where events can be emitted or received by either Go or Javascript. Optionally, data may be passed with the events. Listeners will receive the data in the local data types. + +### EventsOn + +This method sets up a listener for the given event name. When an event of type `eventName` is [emitted](#EventsEmit), the callback is triggered. Any additional data sent with the emitted event will be passed to the callback. It returns a function to cancel the listener. + +Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOff + +This method unregisters the listener for the given event name, optionally multiple listeneres can be unregistered via `additionalEventNames`. + +Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...string)`
JS: `EventsOff(eventName string, ...additionalEventNames)` + +### EventsOnce + +This method sets up a listener for the given event name, but will only trigger once. It returns a function to cancel the listener. + +Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOnMultiple + +This method sets up a listener for the given event name, but will only trigger a maximum of `counter` times. It returns a function to cancel the listener. + +Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`
JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void` + +### EventsEmit + +This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners. + +Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`
JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx new file mode 100644 index 00000000..7bb1ed83 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx @@ -0,0 +1,84 @@ +--- +sidebar_position: 1 +--- + +# Introduction + +The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime and the aim is to try and keep them at parity where possible. + +It has utility methods for: + +- [Window](window.mdx) +- [Menu](menu.mdx) +- [Dialog](dialog.mdx) +- [Events](events.mdx) +- [Browser](browser.mdx) +- [Log](log.mdx) + +The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package take a context as the first parameter. This context should be obtained from the [OnStartup](../options.mdx#onstartup) or [OnDomReady](../options.mdx#ondomready) hooks. + +:::info Note + +Whilst the context will be provided to the [OnStartup](../options.mdx#onstartup) method, there's no guarantee the runtime will work in this method as the window is initialising in a different thread. If you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ondomready). + +::: + +The Javascript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev` mode that provides Typescript declarations for the runtime. This should be located in the `wailsjs` directory in your frontend directory. + +### Hide + +Go: `Hide(ctx context.Context)`
JS: `Hide()` + +Hides the application. + +:::info Note + +On Mac, this will hide the application in the same way as the `Hide` menu item in standard Mac applications. This is different to hiding the window, but the application still being in the foreground. For Windows and Linux, this is currently the same as `WindowHide`. + +::: + +### Show + +Shows the application. + +:::info Note + +On Mac, this will bring the application back into the foreground. For Windows and Linux, this is currently the same as `WindowShow`. + +::: + +Go: `Show(ctx context.Context)`
JS: `Show()` + +### Quit + +Quits the application. + +Go: `Quit(ctx context.Context)`
JS: `Quit()` + +### Environment + +Returns details of the current environment. + +Go: `Environment(ctx context.Context) EnvironmentInfo`
JS: `Environment(): Promise` + +#### EnvironmentInfo + +Go: + +```go +type EnvironmentInfo struct { + BuildType string + Platform string + Arch string +} +``` + +JS: + +```ts +interface EnvironmentInfo { + buildType: string; + platform: string; + arch: string; +} +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx new file mode 100644 index 00000000..e5e6ea7a --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 3 +--- + +# Log + +The Wails runtime provides a logging mechanism that may be called from Go or Javascript. Like most loggers, there are a number of log levels: + +- Trace +- Debug +- Info +- Warning +- Error +- Fatal + +The logger will output any log message at the current, or higher, log level. Example: The `Debug` log level will output all messages except `Trace` messages. + +### LogPrint + +Logs the given message as a raw message. + +Go: `LogPrint(ctx context.Context, message string)`
JS: `LogPrint(message: string)` + +### LogPrintf + +Logs the given message as a raw message. + +Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`
+ +### LogTrace + +Logs the given message at the `Trace` log level. + +Go: `LogTrace(ctx context.Context, message string)`
JS: `LogTrace(message: string)` + +### LogTracef + +Logs the given message at the `Trace` log level. + +Go: `LogTracef(ctx context.Context, format string, args ...interface{})`
+ +### LogDebug + +Logs the given message at the `Debug` log level. + +Go: `LogDebug(ctx context.Context, message string)`
JS: `LogDebug(message: string)` + +### LogDebugf + +Logs the given message at the `Debug` log level. + +Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`
+ +### LogInfo + +Logs the given message at the `Info` log level. + +Go: `LogInfo(ctx context.Context, message string)`
JS: `LogInfo(message: string)` + +### LogInfof + +Logs the given message at the `Info` log level. + +Go: `LogInfof(ctx context.Context, format string, args ...interface{})`
+ +### LogWarning + +Logs the given message at the `Warning` log level. + +Go: `LogWarning(ctx context.Context, message string)`
JS: `LogWarning(message: string)` + +### LogWarningf + +Logs the given message at the `Warning` log level. + +Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`
+ +### LogError + +Logs the given message at the `Error` log level. + +Go: `LogError(ctx context.Context, message string)`
JS: `LogError(message: string)` + +### LogErrorf + +Logs the given message at the `Error` log level. + +Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`
+ +### LogFatal + +Logs the given message at the `Fatal` log level. + +Go: `LogFatal(ctx context.Context, message string)`
JS: `LogFatal(message: string)` + +### LogFatalf + +Logs the given message at the `Fatal` log level. + +Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`
+ +### LogSetLogLevel + +Sets the log level. In Javascript, the number relates to the following log levels: + +| Value | Log Level | +| ----- | --------- | +| 1 | Trace | +| 2 | Debug | +| 3 | Info | +| 4 | Warning | +| 5 | Error | + +Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`
JS: `LogSetLogLevel(level: number)` + +## Using a Custom Logger + +A custom logger may be used by providing it using the [Logger](../options.mdx#logger) application option. The only requirement is that the logger implements the `logger.Logger` interface defined in `github.com/wailsapp/wails/v2/pkg/logger`: + +```go title="logger.go" +type Logger interface { + Print(message string) + Trace(message string) + Debug(message string) + Info(message string) + Warning(message string) + Error(message string) + Fatal(message string) +} +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx new file mode 100644 index 00000000..da4b74b6 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx @@ -0,0 +1,25 @@ +--- +sidebar_position: 6 +--- + +# Menu + +These methods are related to the application menu. + +:::info Javascript + +Menu is currently unsupported in the JS runtime. + +::: + +### MenuSetApplicationMenu + +Sets the application menu to the given [menu](../menus.mdx). + +Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)` + +### MenuUpdateApplicationMenu + +Updates the application menu, picking up any changes to the menu passed to `MenuSetApplicationMenu`. + +Go: `MenuUpdateApplicationMenu(ctx context.Context)` 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 new file mode 100644 index 00000000..9eeee137 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -0,0 +1,221 @@ +--- +sidebar_position: 4 +--- + +# Window + +These methods give control of the application window. + +### WindowSetTitle + +Sets the text in the window title bar. + +Go: `WindowSetTitle(ctx context.Context, title string)`
JS: `WindowSetTitle(title: string)` + +### WindowFullscreen + +Makes the window full screen. + +Go: `WindowFullscreen(ctx context.Context)`
JS: `WindowFullscreen()` + +### WindowUnfullscreen + +Restores the previous window dimensions and position prior to full screen. + +Go: `WindowUnfullscreen(ctx context.Context)`
JS: `WindowUnfullscreen()` + +### WindowIsFullscreen + +Returns true if the window is full screen. + +Go: `WindowIsFullscreen(ctx context.Context) bool`
JS: `WindowIsFullscreen() bool` + +### WindowCenter + +Centers the window on the monitor the window is currently on. + +Go: `WindowCenter(ctx context.Context)`
JS: `WindowCenter()` + +### WindowExecJS + +Executes arbitrary JS code in the window. + +This method runs the code in the browser asynchronously and returns immediately. If the script causes any errors, they will only be available in the browser console. + +Go: `WindowExecJS(ctx context.Context, js string)` + +### WindowReload + +Performs a "reload" (Reloads current page). + +Go: `WindowReload(ctx context.Context)`
JS: `WindowReload()` + +### WindowReloadApp + +Reloads the application frontend. + +Go: `WindowReloadApp(ctx context.Context)`
JS: `WindowReloadApp()` + +### WindowSetSystemDefaultTheme + +Windows only. + +Go: `WindowSetSystemDefaultTheme(ctx context.Context)`
JS: `WindowSetSystemDefaultTheme()` + +Sets window theme to system default (dark/light). + +### WindowSetLightTheme + +Windows only. + +Go: `WindowSetLightTheme(ctx context.Context)`
JS: `WindowSetLightTheme()` + +Sets window theme to light. + +### WindowSetDarkTheme + +Windows only. + +Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` + +Sets window theme to dark. + +### WindowShow + +Shows the window, if it is currently hidden. + +Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` + +### WindowHide + +Hides the window, if it is currently visible. + +Go: `WindowHide(ctx context.Context)`
JS: `WindowHide()` + +### WindowIsNormal + +Returns true if the window not minimised, maximised or fullscreen. + +Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` + +### WindowSetSize + +Sets the width and height of the window. + +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` + +### WindowGetSize + +Gets the width and height of the window. + +Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `WindowGetSize() : Size` + +### WindowSetMinSize + +Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` + +### WindowSetMaxSize + +Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` + +### WindowSetAlwaysOnTop + +Sets the window AlwaysOnTop or not on top. + +Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlwaysOnTop(b: Boolen)` + +### WindowSetPosition + +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)` + +### WindowGetPosition + +Gets the window position relative to the monitor the window is currently on. + +Go: `WindowGetPosition(ctx context.Context) (x int, y int)`
JS: `WindowGetPosition() : Position` + +### WindowMaximise + +Maximises the window to fill the screen. + +Go: `WindowMaximise(ctx context.Context)`
JS: `WindowMaximise()` + +### WindowUnmaximise + +Restores the window to the dimensions and position prior to maximising. + +Go: `WindowUnmaximise(ctx context.Context)`
JS: `WindowUnmaximise()` + +### WindowIsMaximised + +Returns true if the window is maximised. + +Go: `WindowIsMaximised(ctx context.Context) bool`
JS: `WindowIsMaximised() bool` + +### WindowToggleMaximise + +Toggles between Maximised and UnMaximised. + +Go: `WindowToggleMaximise(ctx context.Context)`
JS: `WindowToggleMaximise()` + +### WindowMinimise + +Minimises the window. + +Go: `WindowMinimise(ctx context.Context)`
JS: `WindowMinimise()` + +### WindowUnminimise + +Restores the window to the dimensions and position prior to minimising. + +Go: `WindowUnminimise(ctx context.Context)`
JS: `WindowUnminimise()` + +### WindowIsMinimised + +Returns true if the window is minimised. + +Go: `WindowIsMinimised(ctx context.Context) bool`
JS: `WindowIsMinimised() bool` + +### WindowSetBackgroundColour + +Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. + +Valid values for R, G, B and A are 0-255. + +:::info Windows + +On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255. + +::: + +Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` + +## Typescript Object Definitions + +### Position + +```ts +interface Position { + x: number; + y: number; +} +``` + +### Size + +```ts +interface Size { + w: number; + h: number; +} +``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx b/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx new file mode 100644 index 00000000..1af16f77 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx @@ -0,0 +1,245 @@ +--- +sidebar_position: 20 +--- + +# Dogs API + +```mdx-code-block +
+ +
+
+``` + +:::note + +This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples). + +::: + +In this tutorial we are going to develop an application that retrieves photos of dogs from the web and then displays them. + +### Create the project + +Let's create the application. From a terminal enter: `wails init -n dogs-api -t svelte` + +Note: We could optionally add `-ide vscode` or `-ide goland` to the end of this command if you wanted to add IDE support. + +Now let's `cd dogs-api` and start editing the project files. + +### Remove unused code + +We will start by removing some elements that we know we will not use: + +- Open `app.go` and remove the following lines: + +```go +// Greet returns a greeting for the given name +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s, It's show time!", name) +} +``` + +- Open `frontend/src/App.svelte` and delete all lines. +- Delete the `frontend/src/assets/images/logo-universal.png` file + +### Creating our application + +Now let's add our new Go code. + +Add the following struct declarations to `app.go` before the function definitions: + +```go +type RandomImage struct { + Message string + Status string +} + +type AllBreeds struct { + Message map[string]map[string][]string + Status string +} + +type ImagesByBreed struct { + Message []string + Status string +} +``` + +Add the following functions to `app.go` (perhaps after the existing function definitions): + +```go +func (a *App) GetRandomImageUrl() string { + response, err := http.Get("https://dog.ceo/api/breeds/image/random") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data RandomImage + json.Unmarshal(responseData, &data) + + return data.Message +} + +func (a *App) GetBreedList() []string { + var breeds []string + + response, err := http.Get("https://dog.ceo/api/breeds/list/all") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data AllBreeds + json.Unmarshal(responseData, &data) + + for k := range data.Message { + breeds = append(breeds, k) + } + + sort.Strings(breeds) + + return breeds +} + +func (a *App) GetImageUrlsByBreed(breed string) []string { + + url := fmt.Sprintf("%s%s%s%s", "https://dog.ceo/api/", "breed/", breed, "/images") + response, err := http.Get(url) + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data ImagesByBreed + json.Unmarshal(responseData, &data) + + return data.Message +} +``` + +Modify the `import` section of `app.go` to look like this: + +```go +import ( + "context" + "fmt" + "encoding/json" + "io/ioutil" + "log" + "net/http" + "sort" +) +``` + +Add the following lines to `frontend/src/App.svelte`: + + +```html + + +

Dogs API

+
+ + Click on down arrow to select a breed + + +
+
+{#if showRandomPhoto} + No dog found +{/if} +{#if showBreedPhotos} + {#each photos as photo} + No dog found + {/each} +{/if} + + +``` + + +### Testing the application + +To generate the bindings and test the application, run `wails dev`. + +### Compiling the application + +To compile the application to a single, production grade binary, run `wails build`. 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 new file mode 100644 index 00000000..b783461d --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -0,0 +1,122 @@ +--- +sidebar_position: 10 +--- + +# Hello World + +The aim of this tutorial is to get you up and running with the most basic application using Wails. You will be able to: + +- Create a new Wails application +- Build the application +- Run the application + +:::note + +This tutorial uses Windows as the target platform. Output will vary slightly depending on your operating system. + +::: + +## Create a new Wails application + +To create a new Wails application using the default vanilla JS template, you need to run the following command: + +```bash +wails init -n helloworld +``` + +You should see something similar to the following: + +``` +Wails CLI v2.0.0 + +Initialising Project 'helloworld' +--------------------------------- + +Project Name: helloworld +Project Directory: C:\Users\leaan\tutorial\helloworld +Project Template: vanilla +Template Support: https://wails.io + +Initialised project 'helloworld' in 232ms. +``` + +This will create a new directory called `helloworld` in the current directory. In this directory, you will find a number of files: + +``` +build/ - Contains the build files + compiled application +frontend/ - Contains the frontend files +app.go - Contains the application code +main.go - The main program with the application configuration +wails.json - The project configuration file +go.mod - The go module file +go.sum - The go module checksum file +``` + +## Build the application + +To build the application, change to the new `helloworld` project directory and run the following command: + +```bash +wails build +``` + +You should see something like the following: + +``` +Wails CLI v2.0.0 + +App Type: desktop +Platforms: windows/amd64 +Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe +Build Mode: Production +Skip Frontend: false +Compress: false +Package: true +Clean Build Dir: false +LDFlags: "" +Tags: [] +Race Detector: false + +Building target: windows/amd64 +------------------------------ + - Installing frontend dependencies: Done. + - Compiling frontend: Done. + - Generating bundle assets: Done. + - Compiling application: Done. +Built 'C:\Users\leaan\tutorial\helloworld\build\bin\helloworld.exe' in 10.616s. +``` + +This has compiled the application and saved it in the `build/bin` directory. + +## Run the application + +If we view the `build/bin` directory in Windows Explorer, we should see our project binary: + +```mdx-code-block +
+ +
+
+``` + +We can run it by simply double-clicking the `helloworld.exe` file. + +On Mac, Wails generates a `helloworld.app` file which can be run by double-clicking it. + +On Linux, you can run the application using `./helloworld` from the `build/bin` directory. + +You should see the application working as expected: + +```mdx-code-block +
+ +
+
+``` diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json new file mode 100644 index 00000000..9adb2448 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.0.0-rc.1", + "description": "The label for version v2.0.0-rc.1" + }, + "sidebar.docs.category.Getting Started": { + "message": "Pour démarrer", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Références", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Exécution", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Communauté", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Galerie", + "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": "Tutoriels", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.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.0.0.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.0.0.json new file mode 100644 index 00000000..8d0676b8 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.0.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.0.0", + "description": "The label for version v2.0.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Pour démarrer", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Références", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Exécution", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Communauté", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Galerie", + "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": "Tutoriels", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.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.1.0.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.1.0.json new file mode 100644 index 00000000..024d57fd --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.1.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.1.0", + "description": "The label for version v2.1.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Pour démarrer", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Références", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Exécution", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Communauté", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Galerie", + "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": "Tutoriels", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.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.2.0.json b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.2.0.json new file mode 100644 index 00000000..f887fc2e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-docs/version-v2.2.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.2.0", + "description": "The label for version v2.2.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Pour démarrer", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Références", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "Exécution", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "Communauté", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Galerie", + "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": "Tutoriels", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.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-pages/changelog.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx new file mode 100644 index 00000000..87672406 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/changelog.mdx @@ -0,0 +1,570 @@ +# Historique des modifications + +Toutes les modifications notables de ce projet seront documentées dans ce fichier. + +Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), et ce projet adhère au [Versionnement sémantique](https://semver.org/spec/v2.0.0.html) (SemVer). + +- `Ajouts` pour l'ajout de nouvelles fonctionnalités. +- `Changements` pour les changements des fonctionnalités existantes. +- `Déprécié` pour prévenir des fonctionnalités qui seront bientôt retirées. +- `Retraits` pour les fonctionnalités que l'on retire. +- `Corrections` pour les corrections de bugs. +- `Sécurité` en cas de vulnérabilités. + +## [Unreleased] + +### Ajouts +- Ajout de l'option `OpenInspectorOnStartup` au débogage pour permettre d'ouvrir le WebInspector au démarrage de l'application en mode débogage . Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2080) +- Sur MacOS, `wails doctor` affiche à présent la version de Xcode installée. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2089) +- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2091) + +### Corrections +- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081) +- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103) + +## v2.2.0 - 2022-11-09 + +### Ajouts + +- Wails now uses a purpose built, native Go implementation of Microsoft's webview2loader dll. This means there is no need to embed the `Webview2Loader.dll` file in your binaries, meaning filesizes will be ~130k smaller! Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/1974)! +- This release provides much more control over custom asset handling via the new [AssetServer](https://wails.io/docs/reference/options#assetserver) options. This allows you to provide your own custom asset handler and hook into the request chain through middleware. Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/2016) and @mholt for the [initial idea](https://github.com/wailsapp/wails/issues/2007) and extensive testing. +- It is now possible to customise the layout of your Wails projects using 2 new options in `wails.json`: + - `build:dir` can be used to specify where the build files reside + - `frontend:dir` can be used to specify where the frontend files reside + - If `go.mod` is not found in the same directory as `wails.json`, the cli will look up the parent directories to find it. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2009) +- Colour output in the CLI can now be turned off by using the `--nocolor` flag. This is useful for CI/CD pipelines. Thanks to @scottopell for the [PR](https://github.com/wailsapp/wails/pull/1947) +- A JSON schema definition for the `wails.json` file has been added. IDEs should now provide code complete when editing `wails.json`. Thanks to @binyamin for the [PR](https://github.com/wailsapp/wails/pull/1864) +- The `EventsOn*` methods now return a function that can be called to deregister the listener. Thanks to @joshbuddy for the [PR](https://github.com/wailsapp/wails/pull/1969) + +### Corrections + +- Webview2 on Windows returns a potential whitespace when defining the style like this style="--wails-draggable: drag". Fixed by @stffabi in https://github.com/wailsapp/wails/pull/1989 +- Bound structs that had `struct{}` field types would cause the Typescript generation to fail. Thanks to @ParkourLiu for the [PR](https://github.com/wailsapp/wails/pull/1999) +- When maximising a frameless window on Windows with multiple monitors, the window could sometimes become blank. Thanks to @stffabi for the [fix](https://github.com/wailsapp/wails/pull/2043) + +### Changements + +- The troubleshooting guide was updated to provide guidance when [Vite fails to start](https://wails.io/docs/guides/troubleshooting#cannot-start-service-host-version-xxx-does-not-match-binary-version-xxx). Thanks to @willdot for the [PR](https://github.com/wailsapp/wails/pull/2000). +- English, Chinese and Japanese documentation updates. Thanks to @misitebao. + +### Déprécié + +- The [AssetsHandler](https://wails.io/docs/reference/options#assetshandler) option has been deprecated. Please use the [AssetServer](https://wails.io/docs/reference/options#assetserver) option instead. + +### New Contributors + +- @willdot made their first contribution in https://github.com/wailsapp/wails/pull/2000 +- @ParkourLiu made their first contribution in https://github.com/wailsapp/wails/pull/1999 +- @binyamin made their first contribution in https://github.com/wailsapp/wails/pull/1864 +- @joshbuddy made their first contribution in https://github.com/wailsapp/wails/pull/1969 +- @sgosiaco made their first contribution in https://github.com/wailsapp/wails/pull/2062 + +## v2.1.0 - 2022-10-18 + +### Retraits + +- The `RGBA` option in `options.App` has now been removed. Use `BackgroundColour` instead. + +### Ajouts + +- [Support for defaulting to No button in Windows dialogs](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony in https://github.com/wailsapp/wails/pull/1875 +- Add missing resize for frameless window on Linux - @Lyimmi in https://github.com/wailsapp/wails/pull/1918 +- [Add window transparency for linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi in https://github.com/wailsapp/wails/pull/1926 +- [Add WindowExecJS method](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony in https://github.com/wailsapp/wails/pull/1927 +- [Add support for `Info.dev.plist` on macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony in https://github.com/wailsapp/wails/pull/1960 +- [Add ZoomFactor get/set and add the respective windows only options](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye in https://github.com/wailsapp/wails/pull/1463 + +### Corrections + +- Embed directories auto-created if they don't exist - @leaanthony in https://github.com/wailsapp/wails/pull/1983 +- Quote command arguments if they have a space - @leaanthony in https://github.com/wailsapp/wails/pull/1892 +- Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916 +- Fix gtk_window_begin_resize_drag's mouse button - @Lyimmi in https://github.com/wailsapp/wails/pull/1920 +- Fix binding generation special cases - @JulioDRF in https://github.com/wailsapp/wails/pull/1902 +- Remove the `.git` directory in the template - @misitebao in https://github.com/wailsapp/wails/pull/1929 +- Fix wails dev - @JulioDRF in https://github.com/wailsapp/wails/pull/1931 +- Fix for considering new `go` files in dev filesystem watcher - @scottopell in https://github.com/wailsapp/wails/pull/1946 +- Prevent type parsing to interfere with Typescript package name - @ValentinTrinque in https://github.com/wailsapp/wails/pull/1942 +- [dev] Do not try to infer assetdir from fs.FS when a frontend dev server is in use - @stffabi in https://github.com/wailsapp/wails/pull/1972 +- Fix init command not listed in wails help message - @lyon-lee-dev in https://github.com/wailsapp/wails/pull/1976 + +### Changements + +- Add PR checks - @leaanthony in https://github.com/wailsapp/wails/pull/1879 +- Auto label project cards - @leaanthony in https://github.com/wailsapp/wails/pull/1881 +- Add issue translator - @leaanthony in https://github.com/wailsapp/wails/pull/1891 +- Update label names in the issue template - @misitebao in https://github.com/wailsapp/wails/pull/1893 +- obfuscated instead of obfuscate in the docs - @arifali123 in https://github.com/wailsapp/wails/pull/1895 +- [assetHandler] Remove redundant log prefix - @stffabi in https://github.com/wailsapp/wails/pull/1896 +- [dev] Do not generate bindings in the dev app itself - @stffabi in https://github.com/wailsapp/wails/pull/1899 +- Update Chinese translation - @almas1992 in https://github.com/wailsapp/wails/pull/1894 +- Refactor app - @leaanthony in https://github.com/wailsapp/wails/pull/1909 +- Update documents - @misitebao in https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936 +- Adding Tutorial link - @raguay in https://github.com/wailsapp/wails/pull/1903 +- Add react-ts-vite-tailwind template - @hotafrika in https://github.com/wailsapp/wails/pull/1930 +- Update README.zh-Hans.md - @o8x in https://github.com/wailsapp/wails/pull/1949 +- Add Elm Tailwind CSS community template - @rnice01 in https://github.com/wailsapp/wails/pull/1939 +- Chore/generate sponsors - @leaanthony in https://github.com/wailsapp/wails/pull/1965 +- Use swc + pnpm for website - @leaanthony in https://github.com/wailsapp/wails/pull/1966 +- Sort structs in models.ts - @leaanthony in https://github.com/wailsapp/wails/pull/1961 +- Update Sponsor Image - @github-actions in https://github.com/wailsapp/wails/pull/1973 +- docs: sync documents - @misitebao in https://github.com/wailsapp/wails/pull/1968 +- Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979 + +### Nouveaux Contributeurs + +- @arifali123 made their first contribution in https://github.com/wailsapp/wails/pull/1895 +- @almas1992 made their first contribution in https://github.com/wailsapp/wails/pull/1894 +- @JulioDRF made their first contribution in https://github.com/wailsapp/wails/pull/1902 +- @hotafrika made their first contribution in https://github.com/wailsapp/wails/pull/1930 +- @scottopell made their first contribution in https://github.com/wailsapp/wails/pull/1946 +- @o8x made their first contribution in https://github.com/wailsapp/wails/pull/1949 +- @rnice01 made their first contribution in https://github.com/wailsapp/wails/pull/1939 +- @cuigege made their first contribution in https://github.com/wailsapp/wails/pull/1979 +- @lyon-lee-dev made their first contribution in https://github.com/wailsapp/wails/pull/1976 + +## v2.0.0 - 2022-09-22 + +### Corrections + +- Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858 +- Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862 + +### Changements + +- Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854 +- Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853 +- chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848 +- Update introduction.mdx by @ParvinEyvazov in https://github.com/wailsapp/wails/pull/1863 +- Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869 +- Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849 + +### New Contributors + +- @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863 + +## v2.0.0-rc.1 - 2022-09-13 + +### Déprécié + +- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command. + +### Ajouts + +- Add garble support by @leaanthony in https://github.com/wailsapp/wails/pull/1793 +- Make draggable CSS property customisable by @leaanthony in https://github.com/wailsapp/wails/pull/1828 +- Add Some WindowState by @zandercodes in https://github.com/wailsapp/wails/pull/1349 +- Make EventsOff capable of removing multiple listeners by @Lyimmi in https://github.com/wailsapp/wails/pull/1822 + +### Corrections + +- Use `Promise` when Go routine does not output by @SheetJSDev in https://github.com/wailsapp/wails/pull/1821 +- preact-ts template build fix by @Debdut in https://github.com/wailsapp/wails/pull/1781 +- fix frontend/tsconfig.js by @Lyimmi in https://github.com/wailsapp/wails/pull/1795 +- fix: fix bugs in website by @misitebao in https://github.com/wailsapp/wails/pull/1810 +- Fix vue-ts template by @leaanthony in https://github.com/wailsapp/wails/pull/1813 +- Remove duplicate defs in win32/window.go by @AlbinoDrought in https://github.com/wailsapp/wails/pull/1832 + +### Changements + +- Upgrade React to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1744 +- Upgrade Lit to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1745 +- Support vite3 for Vue by @leaanthony in https://github.com/wailsapp/wails/pull/1746 +- Preact templates for vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1770 +- Prevent env variables and registry overrides from changing behaviour by @stffabi in https://github.com/wailsapp/wails/pull/1771 +- Use go implementation to retrieve the version of a fixed runtime by @stffabi in https://github.com/wailsapp/wails/pull/1790 +- Change contribution guide type from "doc" to "page" by @misitebao in https://github.com/wailsapp/wails/pull/1777 +- feat(website): repair document content by @misitebao in https://github.com/wailsapp/wails/pull/1775 +- chore: sort out files by @misitebao in https://github.com/wailsapp/wails/pull/1776 +- Add Korean to doc by @jaesung9507 in https://github.com/wailsapp/wails/pull/1774 +- Add README.ja.md by @shinshin86 in https://github.com/wailsapp/wails/pull/1783 +- Reorganized contribution guidelines page by @misitebao in https://github.com/wailsapp/wails/pull/1784 +- fix(website): fix link by @misitebao in https://github.com/wailsapp/wails/pull/1785 +- Update templates.mdx by @KiddoV in https://github.com/wailsapp/wails/pull/1799 +- Better watcher by @leaanthony in https://github.com/wailsapp/wails/pull/1827 +- Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" by @prurigro in https://github.com/wailsapp/wails/pull/1811 +- Optimize images by @imgbot in https://github.com/wailsapp/wails/pull/1812 + +### New Contributors + +- @shinshin86 made their first contribution in https://github.com/wailsapp/wails/pull/1783 +- @Debdut made their first contribution in https://github.com/wailsapp/wails/pull/1781 +- @KiddoV made their first contribution in https://github.com/wailsapp/wails/pull/1799 +- @zandercodes made their first contribution in https://github.com/wailsapp/wails/pull/1349 +- @prurigro made their first contribution in https://github.com/wailsapp/wails/pull/1811 +- @SheetJSDev made their first contribution in https://github.com/wailsapp/wails/pull/1821 +- @AlbinoDrought made their first contribution in https://github.com/wailsapp/wails/pull/1832 +- @imgbot made their first contribution in https://github.com/wailsapp/wails/pull/1812 + +## v2.0.0-beta.44 - 2022-08-20 + +### Déprécié + +The `data-wails-drag` attribute is being deprecated in favour of the following CSS style: `style="--wails-draggable:drag"`. You can use `style="--wails-draggable:no-drag"` to disable the drag behaviour. For this release only, you can test this by setting the following application option: + +```go +Experimental: &options.Experimental{ + UseCSSDrag: true, +}, +``` + +### Ajouts + +- Set file permissions for generated files by @leaanthony in https://github.com/wailsapp/wails/pull/1763 +- Experimental support for CSS Drag detection by @leaanthony in https://github.com/wailsapp/wails/pull/1750 + +### Corrections + +- Bug fix collecting of output binaries for platforms by @stffabi in https://github.com/wailsapp/wails/pull/1715 +- Fix registration of exposed fields by @ValentinTrinque in https://github.com/wailsapp/wails/pull/1727 +- Fix column widths for doctor command's dependencies table by @ianmjones in https://github.com/wailsapp/wails/pull/1717 +- Do not generate bindings for `OnBeforeClose` method + +### Changements + +- Misc code refactors and removal by @leaanthony in https://github.com/wailsapp/wails/pull/1713 +- Add react-router to routing.mdx by @Maicarons2022 in https://github.com/wailsapp/wails/pull/1755 +- Add Japanese to doc by @RyoTagami in https://github.com/wailsapp/wails/pull/1716 +- Added EmailIt and Modal File Manager by @raguay in https://github.com/wailsapp/wails/pull/1728 +- Adding my ScriptBar program by @raguay in https://github.com/wailsapp/wails/pull/1761 +- Link to general webview2 runtime download page and not to a specific language by @stffabi in https://github.com/wailsapp/wails/pull/1764 +- Updated translations in https://github.com/wailsapp/wails/pull/1719 and https://github.com/wailsapp/wails/pull/1720 +- Remove text outside style's brackets by @DragoSpiro98 in https://github.com/wailsapp/wails/pull/1765 + +### New Contributors + +- @RyoTagami made their first contribution in https://github.com/wailsapp/wails/pull/1716 +- @raguay made their first contribution in https://github.com/wailsapp/wails/pull/1728 +- @Maicarons2022 made their first contribution in https://github.com/wailsapp/wails/pull/1755 +- @DragoSpiro98 made their first contribution in https://github.com/wailsapp/wails/pull/1765 + +## v2.0.0-beta.43 - 2022-08-08 + +### Ajouts + +- Add support for retrieving the release notes from Github by @leaanthony in https://github.com/wailsapp/wails/pull/1679 +- Add `frontend:dev:install` configuration by @LGiki in https://github.com/wailsapp/wails/pull/1666 + +### Corrections + +- Fix formatting of some error messages by @stffabi in https://github.com/wailsapp/wails/pull/1665 +- Windows dialogs now work when window is not visible yet by @leaanthony in https://github.com/wailsapp/wails/pull/1662 +- Multiple fixes for MacOS asset requests by @stffabi in https://github.com/wailsapp/wails/pull/1668 and https://github.com/wailsapp/wails/pull/1681 +- Fix for Go 1.19 by @stffabi in https://github.com/wailsapp/wails/pull/1689 +- Removed Linux warnings by @leaanthony in https://github.com/wailsapp/wails/pull/1656 +- Better support for doubleclick events in drag regions by @leaanthony in https://github.com/wailsapp/wails/pull/1704 +- Allow MacOS frameless window to be miniturisable by @leaanthony in https://github.com/wailsapp/wails/pull/1705 + +### Changements + +- add wails-sveltekit-template by @h8gi in https://github.com/wailsapp/wails/pull/1671 +- wails doctor now reports correct MacOS os id by @stffabi in https://github.com/wailsapp/wails/pull/1673 +- Update application-development.mdx by @SamHennessy in https://github.com/wailsapp/wails/pull/1682 +- Move SetMin/Max calls to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1684 +- Change `frontend:dev` to `frontend:dev:build` by @LGiki in https://github.com/wailsapp/wails/pull/1691 +- Build frontend only before starting the dev watcher command by @stffabi in https://github.com/wailsapp/wails/pull/1694 +- Improve error message for auto dev server discovery without a dev watcher by @stffabi in https://github.com/wailsapp/wails/pull/1711 + +### New Contributors + +- @h8gi made their first contribution in https://github.com/wailsapp/wails/pull/1671 +- @SamHennessy made their first contribution in https://github.com/wailsapp/wails/pull/1682 + +## v2.0.0-beta.42 - 2022-07-25 + +### Ajouts + +- Added `options.NewRGBA` and `options.NewRGB` functions to create `*options.RGBA` by @leaanthony + +### Corrections + +- Fixed initial build of frontend when using `wails dev` on new projects by @leaanthony in https://github.com/wailsapp/wails/pull/1650 +- Ignore empty install command when running `wails dev` by @stffabi in https://github.com/wailsapp/wails/pull/1651 +- Fixed error reporting in templates +- BackgroundColour documentation fix +- Generalize manual compile steps [Documentation] by @acheong08 in https://github.com/wailsapp/wails/pull/1644 + +## v2.0.0-beta.40 - 2022-07-24 + +### Ajouts + +- Add Show() and Hide() to runtime to show/hide application by @leaanthony in https://github.com/wailsapp/wails/pull/1599 +- Override target platform/arch using GOOS and GOARCH environment variables by @leaanthony in https://github.com/wailsapp/wails/pull/1618 +- Add option to skip frontend rebuild in dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1632 + +### Corrections + +- Update svelte templates to use vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1643 +- Fix plain template by @stffabi in https://github.com/wailsapp/wails/pull/1609 +- Fix Website layout by @leaanthony in https://github.com/wailsapp/wails/pull/1616 +- Fixed typo in documentation page docs/howdoesitwork by @MyNameIsAres in https://github.com/wailsapp/wails/pull/1636 +- Use scaling when setting min/max window by @leaanthony in https://github.com/wailsapp/wails/pull/1557 + +### Changements + +- Install dev dependencies before starting dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1615 +- Translate and fix website text by @misitebao in https://github.com/wailsapp/wails/pull/1525 +- docs: add MyNameIsAres as a contributor for doc by @allcontributors in https://github.com/wailsapp/wails/pull/1638 +- Deprecate Fullscreen appoption by @acheong08 in https://github.com/wailsapp/wails/pull/1640 + +### Déprécié + +- The `Fullscreen` application option is deprecated. Please use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) instead. + +### New Contributors + +- @MyNameIsAres made their first contribution in https://github.com/wailsapp/wails/pull/1636 + +## v2.0.0-beta.39.2 - 2022-07-20 + +### Ajouts + +- Update example for macOS Menu by @acheong08 in https://github.com/wailsapp/wails/pull/1600 + +### Corrections + +- Reinstate Go 1.17 compatibility by @leaanthony in https://github.com/wailsapp/wails/pull/1605 + +## v2.0.0-beta.39 - 2022-07-19 + +### Ajouts + +- New screen dimensions runtime API by @skamensky in https://github.com/wailsapp/wails/pull/1519 +- Auto discover vite devserver port by @leaanthony in https://github.com/wailsapp/wails/pull/1547 +- Add nixpkgs support to doctor command. by @ianmjones in https://github.com/wailsapp/wails/pull/1551 +- New pre-build hooks feature by @leaanthony in https://github.com/wailsapp/wails/pull/1578 +- New production log level option by @leaanthony in https://github.com/wailsapp/wails/pull/1555 + +### Corrections + +- Fix stack corruption in Windows when using ICoreWebView2HttpHeadersCollectionIterator by @stffabi in https://github.com/wailsapp/wails/pull/1589 +- Move WindowGet\* to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1464 +- Allow -appargs flag to pass flags to binary. by @ianmjones in https://github.com/wailsapp/wails/pull/1534 +- Fix checking for installed apt package in none English session. by @ianmjones in https://github.com/wailsapp/wails/pull/1548 +- Fix OnBeforeClose code for Mac by @leaanthony in https://github.com/wailsapp/wails/pull/1558 +- Support Maps in TS conversion by @leaanthony in https://github.com/wailsapp/wails/pull/1435 +- Check for line length when scanning for local devserver url by @leaanthony in https://github.com/wailsapp/wails/pull/1566 +- Remove usage of unsafe.Pointer in winc by @stffabi and @leaanthony in https://github.com/wailsapp/wails/pull/1556 + +### Changements + +- Rename WindowSetRGBA -> WindowSetBackgroundColour by @leaanthony in https://github.com/wailsapp/wails/pull/1506 +- Improvements to the dev command by @stffabi in https://github.com/wailsapp/wails/pull/1510 +- Update vscode template by @leaanthony in https://github.com/wailsapp/wails/pull/1398 +- Bump svelte from 3.42.2 to 3.49.0 in /v2/internal/frontend/runtime/dev by @dependabot in https://github.com/wailsapp/wails/pull/1572 +- Bump svelte from 3.42.5 to 3.49.0 in /v2/internal/frontend/runtime by @dependabot in https://github.com/wailsapp/wails/pull/1573 +- Add troubleshooting for `Not Found` error by @acheong08 in https://github.com/wailsapp/wails/pull/1586 +- Docs/better homepage by @leaanthony in https://github.com/wailsapp/wails/pull/1591 + +### New Contributors + +- @skamensky made their first contribution in https://github.com/wailsapp/wails/pull/1519 +- @acheong08 made their first contribution in https://github.com/wailsapp/wails/pull/1586 + +**Full Changelog**: https://github.com/wailsapp/wails/compare/v2.0.0-beta.38...v2.0.0-beta.39 + +## v2.0.0-beta.38 - 2022-06-27 + +### Ajouts + +- Add race detector to build & dev by @Lyimmi in https://github.com/wailsapp/wails/pull/1426 +- [linux] Support `linux/arm` architecture by @Lyimmi in https://github.com/wailsapp/wails/pull/1427 +- Create gitignore when using `-g` option by @jaesung9507 in https://github.com/wailsapp/wails/pull/1430 +- [windows] Add Suspend/Resume callback support by @leaanthony in https://github.com/wailsapp/wails/pull/1474 +- Add runtime function `WindowSetAlwaysOnTop` by @chenxiao1990 in https://github.com/wailsapp/wails/pull/1442 +- [windows] Allow setting browser path by @NanoNik in https://github.com/wailsapp/wails/pull/1448 + +### Corrections + +- [linux] Improve switching to main thread for callbacks by @stffabi in https://github.com/wailsapp/wails/pull/1392 +- [windows] Fix WebView2 minimum runtime version check by @stffabi in https://github.com/wailsapp/wails/pull/1456 +- [linux] Fix apt command syntax (#1458) by @abtin in https://github.com/wailsapp/wails/pull/1461 +- [windows] Set Window Background colour if provided + debounce redraw option by @leaanthony in https://github.com/wailsapp/wails/pull/1466 +- Fix small typo in docs by @LukenSkyne in https://github.com/wailsapp/wails/pull/1449 +- Fix the url to surge by @andywenk in https://github.com/wailsapp/wails/pull/1460 +- Fixed theme change at runtime by @leaanthony in https://github.com/wailsapp/wails/pull/1473 +- Fix: Don't stop if unable to remove temporary bindings build by @leaanthony in https://github.com/wailsapp/wails/pull/1465 +- [windows] Pass the correct installationStatus to the webview installation strategy by @stffabi in https://github.com/wailsapp/wails/pull/1483 +- [windows] Make `SetBackgroundColour` compatible for `windows/386` by @stffabi in https://github.com/wailsapp/wails/pull/1493 +- Fix lit-ts template by @Orijhins in https://github.com/wailsapp/wails/pull/1494 + +### Changements + +- [windows] Load WebView2 loader from embedded only by @stffabi in https://github.com/wailsapp/wails/pull/1432 +- Add showcase entry for October + update homepage carousel entry for October by @marcus-crane in https://github.com/wailsapp/wails/pull/1436 +- Always use return in wrapped method by @leaanthony in https://github.com/wailsapp/wails/pull/1410 +- [windows] Unlock OSThread after native calls have been finished by @stffabi in https://github.com/wailsapp/wails/pull/1441 +- Add `BackgroundColour` and deprecate `RGBA` by @leaanthony in https://github.com/wailsapp/wails/pull/1475 +- AssetsHandler remove retry logic in dev mode by @stffabi in https://github.com/wailsapp/wails/pull/1479 +- Add Solid JS template to docs by @sidwebworks in https://github.com/wailsapp/wails/pull/1492 +- Better signal handling by @leaanthony in https://github.com/wailsapp/wails/pull/1488 +- Chore/react 18 create root by @tomanagle in https://github.com/wailsapp/wails/pull/1489 + +### Nouveaux Contributeurs + +- @jaesung9507 made their first contribution in https://github.com/wailsapp/wails/pull/1430 +- @LukenSkyne made their first contribution in https://github.com/wailsapp/wails/pull/1449 +- @andywenk made their first contribution in https://github.com/wailsapp/wails/pull/1460 +- @abtin made their first contribution in https://github.com/wailsapp/wails/pull/1461 +- @chenxiao1990 made their first contribution in https://github.com/wailsapp/wails/pull/1442 +- @NanoNik made their first contribution in https://github.com/wailsapp/wails/pull/1448 +- @sidwebworks made their first contribution in https://github.com/wailsapp/wails/pull/1492 +- @tomanagle made their first contribution in https://github.com/wailsapp/wails/pull/1489 + +## v2.0.0-beta.37 - 2022-05-26 + +### Ajouts + +- Add `nogen` flag in wails dev command by @mondy in https://github.com/wailsapp/wails/pull/1413 +- Initial support for new native translucency in Windows Preview by @leaanthony in https://github.com/wailsapp/wails/pull/1400 + +### Corrections + +- Bugfix/incorrect bindings by @leaanthony in https://github.com/wailsapp/wails/pull/1383 +- Fix runtime.js events by @polikow in https://github.com/wailsapp/wails/pull/1369 +- Fix docs formatting by @antimatter96 in https://github.com/wailsapp/wails/pull/1372 +- Events | fixes #1388 by @lambdajack in https://github.com/wailsapp/wails/pull/1390 +- bugfix: correct typo by @tmclane in https://github.com/wailsapp/wails/pull/1391 +- Fix typo in docs by @LGiki in https://github.com/wailsapp/wails/pull/1393 +- Fix typo bindings.js to ipc.js by @rayshoo in https://github.com/wailsapp/wails/pull/1406 +- Make sure to execute the menu callbacks on a new goroutine by @stffabi in https://github.com/wailsapp/wails/pull/1403 +- Update runtime.d.ts & templates by @Yz4230 in https://github.com/wailsapp/wails/pull/1421 +- Add missing className to input in React and Preact templates by @edwardbrowncross in https://github.com/wailsapp/wails/pull/1419 + +### Changements + +- Improve multi-platform builds by @stffabi in https://github.com/wailsapp/wails/pull/1373 +- During wails dev only use reload logic if no AssetsHandler are in use by @stffabi in https://github.com/wailsapp/wails/pull/1385 +- Update events.mdx by @Junkher in https://github.com/wailsapp/wails/pull/1387 +- Add Next.js template by @LGiki in https://github.com/wailsapp/wails/pull/1394 +- Add docs on wails generate module by @TechplexEngineer in https://github.com/wailsapp/wails/pull/1414 +- Add macos custom menu EditMenu tips by @daodao97 in https://github.com/wailsapp/wails/pull/1423 + +### Nouveaux Contributeurs + +- @polikow made their first contribution in https://github.com/wailsapp/wails/pull/1369 +- @antimatter96 made their first contribution in https://github.com/wailsapp/wails/pull/1372 +- @Junkher made their first contribution in https://github.com/wailsapp/wails/pull/1387 +- @lambdajack made their first contribution in https://github.com/wailsapp/wails/pull/1390 +- @LGiki made their first contribution in https://github.com/wailsapp/wails/pull/1393 +- @rayshoo made their first contribution in https://github.com/wailsapp/wails/pull/1406 +- @TechplexEngineer made their first contribution in https://github.com/wailsapp/wails/pull/1414 +- @mondy made their first contribution in https://github.com/wailsapp/wails/pull/1413 +- @Yz4230 made their first contribution in https://github.com/wailsapp/wails/pull/1421 +- @daodao97 made their first contribution in https://github.com/wailsapp/wails/pull/1423 +- @edwardbrowncross made their first contribution in https://github.com/wailsapp/wails/pull/1419 + +## v2.0.0-beta.36 - 2022-04-27 + +### Corrections + +- [v2] Validate devServer property to be of the correct form by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1359 +- [v2, darwin] Initialize native variables on stack to prevent segfault by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1362 +- Vue-TS template fix + +### Changements + +- Added `OnStartup` method back to default templates + +## v2.0.0-beta.35 - 2022-04-27 + +### Modifications importantes + +- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324) +- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) + +### Ajouts + +- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info. +- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`! +- Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi) +- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows. +- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript) +- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi) +- Added docs for [code-signing](https://wails.io/docs/guides/signing) and [NSIS installer](https://wails.io/docs/guides/windows-installer) - [@gardc](https://github.com/gardc) +- Add support for `-trimpath` [build flag](https://wails.io/docs/reference/cli#build) +- Add support for a default AssetsHandler - [@stffabi](https://github.com/stffabi) + +### Corrections + +- Improved mimetype detection for BOM marker and comments - [@napalu](https://github.com/napalu) +- Remove duplicate mimetype entries - [@napalu](https://github.com/napalu) +- Remove duplicate Typescript imports in generated definition files - [@adalessa](https://github.com/adalessa) +- Add missing method declaration - [@adalessa](https://github.com/adalessa) +- Fix Linux sigabrt on start - [@napalu](https://github.com/napalu) +- Double Click event now works on elements with `data-wails-drag` attribute - [@jicg](https://github.com/jicg) +- Suppress resizing during minimize of a frameless window - [@stffabi](https://github.com/stffabi) +- Fixed TS/JS generation for Go methods with no returns +- Fixed WailsJS being generated in project directory + +### Changements + +- Website docs are now versioned +- Improved `runtime.Environment` call +- Improve the close action for Mac +- A bunch of dependabot security updates +- Improved website content - [@misitebao](https://github.com/misitebao) +- Upgrade issue template - [@misitebao](https://github.com/misitebao) +- Convert documents that don't require version management to individual pages + - [@misitebao](https://github.com/misitebao) +- Website now using Algolia search + +## v2.0.0-beta.34 - 2022-03-26 + +### Ajouts + +- Add support for 'DomReady' callback on linux by [@napalu](https://github.com/napalu) in #1249 +- MacOS - Show extension by default by [@leaanthony](https://github.com/leaanthony) in #1228 + +### Corrections + +- [v2, nsis] Seems like / as path separator works only for some directives in a cross platform way by [@stffabi](https://github.com/stffabi) in #1227 +- import models on binding definition by [@adalessa](https://github.com/adalessa) in #123 + + 1 + +- Use local search on website by [@leaanthony](https://github.com/leaanthony) in #1234 +- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240 +- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241 +- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243 +- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245 +- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230 +- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247 +- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258 +- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255 +- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257 +- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212 +- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180 + +### Changements + +- feat(website): sync documents and add content by [@misitebao](https://github.com/misitebao) in #1215 +- refactor(cli): optimize default templates by [@misitebao](https://github.com/misitebao) in #1214 +- Run watcher after initial build by [@leaanthony](https://github.com/leaanthony) in #1216 +- Feature/docs update by [@leaanthony](https://github.com/leaanthony) in #1218 +- feat(website): optimize website and sync documents by [@misitebao](https://github.com/misitebao) in #1219 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1224 +- Default index page by [@leaanthony](https://github.com/leaanthony) in #1229 +- Build added win32 compatibility by [@fengweiqiang](https://github.com/fengweiqiang) in #1238 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1260 + +## v2.0.0-beta.33 - 2022-03-05 + +### Ajouts + +- NSIS Installer support for creating installers for Windows applications - Thanks [@stffabi](https://github.com/stffabi) 🎉 +- New frontend:dev:watcher command to spin out 3rd party watchers when using wails dev - Thanks [@stffabi](https://github.com/stffabi)🎉 +- Remote templates now support version tags - Thanks [@misitebao](https://github.com/misitebao) 🎉 + +### Corrections + +- A number of fixes for ARM Linux providing a huge improvement - Thanks [@ianmjones](https://github.com/ianmjones) 🎉 +- Fixed potential Nil reference when discovering the path to `index.html` +- Fixed crash when using `runtime.Log` methods in a production build +- Improvements to internal file handling meaning webworkers will now work on Windows - Thanks [@stffabi](https://github.com/stffabi)🎉 + +### Changements + +- The Webview2 bootstrapper is now run as a normal user and doesn't require admin rights +- The docs have been improved and updated +- Added troubleshooting guide diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/coc.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/coc.mdx new file mode 100644 index 00000000..dd7e01b4 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/coc.mdx @@ -0,0 +1,83 @@ +# Code de Conduite du Contributeur + +## Notre Engagement + +En tant que membres, contributeurs et dirigeants, nous promettons de faire en sorte que votre participation soit sans harcèlement ou discrimination pour tous. Peu importe votre âge, taille, poids, handicap, ethnie, orientation sexuelle, genre, niveau d'expérience, éducation, statut économique, nationalité, apparence, race, caste, couleur de peau ou religion. + +Nous nous engageons à agir et interagir de manière à contribuer à une communauté ouverte, accueillante, diversifiée, inclusive et saine. + +## Nos Critères + +Exemples de comportements qui contribuent à créer un environnement positif : + +- Faire preuve d'empathie et de gentillesse envers les autres +- Être respectueux des différentes opinions, points de vue et expériences +- Donner et accepter gracieusement des retours constructifs +- Accepter la responsabilité de présenter des excuses à ceux qui sont affectés par nos erreurs, et tirer des enseignements de l'expérience +- Ne pas se concentrer sur ce qui est le meilleur pour soi, mais ce qui est le mieux pour la communauté + +Exemples de comportements inacceptables : + +- L’utilisation de langage ou d’images sexualisés, et d’attentions ou d’avances sexuelles de toute nature +- Le "trolling", les commentaires insultants ou désobligeants et les attaques personnelles ou d’ordre politique +- Le harcèlement en public ou en privé +- La publication d’informations privées d’autrui, telle qu’une adresse postale ou une adresse électronique, sans leur autorisation explicite +- Tout autre comportement qui pourrait raisonnablement être considéré comme inapproprié dans un cadre professionnel + +## Responsabilités en matière d'application + +Les responsables de la communauté sont responsables de la clarification et de l'application de nos normes de comportement acceptable. Ils prendront les mesures correctives appropriées et équitables en réponse à tout comportement qu'ils jugent inapproprié, menaçant, offensif, ou nocif. + +Les responsables de la communauté ont le droit et la responsabilité de supprimer, modifier ou rejeter les commentaires, les commits, le code, les modifications de wiki, les bugs et autres contributions qui ne sont pas alignés sur ce code de conduite, et communiquerons les raisons pour une décision de la modération le cas échéant. + +## Périmètre + +Ce code de conduite s'applique à la fois au sein des espaces du projet ainsi que dans les espaces publics lorsqu'un individu représente officiellement le projet ou sa communauté. Des exemples de représentation de la communauté incluent d'utiliser une adresse e-mail officielle, poster un message sur un réseau social avec un compte officiel, ou agir en tant que représentant lors d'un évènement en ligne ou physique. + +## Mise en vigueur + +Des cas de comportement abusif, harcèlement ou tout autre comportement inacceptable peuvent être signalés aux responsables de la communauté à l'adresse e-mail : coc@wails.io . Toutes les plaintes seront examinées et examinées rapidement et équitablement. + +Tous les dirigeants de la communauté sont tenus de respecter la vie privée et la sécurité du rapporteur de l'incident. + +## Règles d'application + +Les dirigeants de la communauté suivront ces lignes directrices sur la communauté pour déterminer les conséquences de toute action qu'ils jugent contraire au présent Code de conduite : + +### 1. Correction + +**Impact sur la communauté**: Utilisation d'un langage inapproprié ou d'un autre comportement jugé non professionnel et mal accueilli dans la communauté. + +**Conséquence**: Un avertissement écrit privé des responsables de la communauté, fournissant des éléments autour de la nature de la violation et une explication de la raison pour laquelle le comportement était inapproprié. Des excuses publiques peuvent être demandées. + +### 2. Avertissement + +**Impact sur la communauté**: Une violation à travers un seul incident ou une seule série d'actions. + +**Conséquence**: Un avertissement avec des conséquences pour un comportement continu. Pas d'interaction avec les personnes impliquées, y compris des interactions non sollicitées avec ceux qui appliquent le code de conduite, pendant une période de temps déterminée. Cela inclut d'éviter les interactions dans les espaces communautaires ainsi que les canaux externes comme les réseaux sociaux. La violation de ces règles peut entraîner un bannissement temporaire ou permanent. + +### 3. Bannissement temporaire + +**Impact sur la communauté**: Une grave violation des règles communautaires, y compris un comportement inapproprié en continu. + +**Conséquence**: Une interdiction temporaire de toute sorte d'interaction ou de communication publique avec la communauté pendant une période déterminée. Aucune d'interaction publique ou privée avec les personnes impliquées, y compris les interactions non sollicitées avec ceux qui appliquent le code de conduite, n'est autorisée pendant cette période. La violation de ces conditions peut entraîner un bannissement permanent. + +### 4. Bannissement permanent + +**Impact sur la communauté**: Manifestation de motifs de violation des règles communautaires, y compris un comportement inapproprié en continu, le harcèlement d'un individu, l'agression ou le dénigrement de catégories d'individus. + +**Conséquence**: Une interdiction permanente de toute forme d'interaction publique au sein de la communauté. + +## Attribution + +Ce code de conduite est adapté du [Contributor Covenant][homepage], version 2.1, disponible ici [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Les directives concernant l'impact sur la communauté ont été inspirées par le [code de conduite de Mozilla][mozilla coc]. + +Pour des réponses aux questions courantes sur ce code de conduite, consultez la FAQ de Contributor Convenant : [https://www.contributor-covenant.org/faq][faq]. Les traductions sont disponibles sur [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx new file mode 100644 index 00000000..558c59d0 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/community-guide.mdx @@ -0,0 +1,141 @@ +# Guide communautaire + +Le nombre d'utilisateurs de Wails augmente à un rythme incroyable, et si vous lisez ça, il y a des chances que vous soyez prêt à nous rejoindre. Alors... Bienvenue ! + +## Ressources + +### Code de Conduite + +Le [Code de Conduite](./coc) est un guide facile à suivre pour développer les communautés techniques auxquelles nous participons. + +### Restez informé + +- Suivez notre [compte Twitter officiel](https://twitter.com/wailsapp). + +### Obtenir de l'aide + +- [GitHub](https://github.com/wailsapp/wails) - Si vous avez un bug à signaler ou une fonctionnalité à demander, c'est ce à quoi les GitHub issues servent. Merci de respecter les règles définies dans les modèles de chaque dépôt de code. +- [Slack](https://gophers.slack.com/messages/CJ4P9F7MZ/) - Un endroit où les développeurs de Wails peuvent se rencontrer et discuter en temps réel. +- [QQ Group(中文)](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Un groupe Wails pour permettre aux développeurs chinois de communiquer, et où vous pourrez trouver de l'aide d'autres développeurs. + +### Explorez l'écosystème + +- [L'incroyable page Wails](https://github.com/wailsapp/awesome-wails) - Voyez quelles autres ressources géniales ont été publiées par d'autres personnes géniales. + +## Comment contribuer + +Wails est un projet open source, orienté par la communauté. Nous souhaitons la bienvenue à tous ceux qui veulent nous rejoindre pour contribuer au projet. Cette documentation s'adresse à toute personne souhaitant se familiariser avec le projet et les processus de développement. + +Il y a plusieurs façons de contribuer au projet : + +- Développer de nouvelles fonctionnalités +- Corriger des Bugs +- Tester +- Documenter les fonctionnalités +- Écrire des tutoriaux / guides +- Aider les autres avec leurs soucis + participer aux discussions + +Des guides ont été créés dans leurs propres sections. Avant de commencer, veuillez vous présenter dans la discussion [Contribuer à Wails](https://github.com/wailsapp/wails/discussions/1520). + +### Développement de nouvelles fonctionnalités + +Nous sommes toujours désireux d'ajouter des fonctionnalités à Wails et de développer ce que le projet peut faire. Le processus d’ajout de nouvelles fonctionnalités est le suivant : + +- Choisissez un ticket d'amélioration avec l'étiquette "TODO". Il est préférable d'en sélectionner un dans le [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) mais le choix vous appartient. +- Avant de développer, vérifiez que le ticket inclut les informations suivantes : + - Le but de l'amélioration + - Qu'est-ce qui est hors de portée pour l'amélioration + - Quelles plateformes vont bénéficier de l'amélioration (la plupart des fonctionnalités sont cross-plateforme à part pour des raisons spécifiques) +- Si le ticket n'inclut pas ces informations, n'hésitez pas à demander les informations à la personne qui a ouvert le ticket. Parfois, des tickets d'initiatives sont créés et nécessitent plus de détails +- Commenter sur le ticket en précisant que vous souhaitez développer la fonctionnalité +- Clonez le dépôt et créez une branche au format `feature/_` +- Les nouvelles fonctionnalités nécessitent souvent de la documentation, donc assurez-vous que vous avez également ajouté ou mis à jour la documentation impactés par vos modifications +- Une fois que la fonctionnalité est prête à être testée, créez un brouillon de PR. Veuillez vous assurer que la description de la PR contient les scénarios de test et les cas de test listés avec les coches, afin que les autres puissent savoir ce qui doit encore être testé. +- Une fois que tous les tests sont terminés, veuillez mettre à jour le statut de la PR à partir du brouillon et laisser un message. + +:::note +Il n'y a rien qui vous empêche d'ouvrir un ticket et d'y travailler vous-même, mais soyez conscient que toutes les demandes d'amélioration sont examinées pour s'assurer qu'elle s'adapte bien au projet. Toutes les idées ne seront pas sélectionnées, il est donc préférable d'avoir une discussion sur l'amélioration en premier. +::: + +:::warning +Toute PRs ouvertes sans ticket correspondant peuvent être rejetées. +::: + +### Corriger des Bugs + +Le processus de correction des bugs est le suivant : + +- Vérifiez le [backlog](https://github.com/orgs/wailsapp/projects/1/views/1) actuel et sélectionnez un bug à corriger +- Avant de développer, vérifiez que le ticket inclut les informations suivantes : +- La portée du problème, y compris les plateformes affectées +- Les étapes pour reproduire le soucis. Parfois, des bugs sont ouverts mais ne sont pas liés à Wails. C'est au rapporteur du bug de prouver que le souci provient de Wails avec un [exemple minimum pouvant être reproduit](https://stackoverflow.com/help/minimal-reproducible-example) +- Le résultat de `wails doctor` +- Si le ticket n'inclut pas ces informations, n'hésitez pas à demander les informations à la personne qui a ouvert le ticket. +- Commenter sur le ticket indiquant que vous souhaitez développer un correctif +- Clonez le dépôt et créez une branche au format `bugfix/_` +- Une fois que le correctif est prêt à être testé, créez un brouillon de PR. Veuillez vous assurer que la description de la PR contient les scénarios de test et les cas de test listés avec les coches, afin que les autres puissent savoir ce qui doit encore être testé. +- Une fois que tous les tests sont terminés, veuillez mettre à jour le statut de la PR à partir du brouillon et laisser un message. + +:::note +Il n'y a rien qui vous empêche d'ouvrir un ticket et d'y travailler vous-même, mais soyez conscient que tous les correctifs doivent être discutés en amont afin d'éviter des effets de bord non désirés. +::: + +:::warning +Toute PRs ouvertes sans ticket correspondant peuvent être rejetées. +::: + +### Tester + +Les tests sont d'une importance vitale pour assurer la qualité du projet. Il y a quelques scénarios où les tests peuvent vraiment aider le projet : + +- Tester si un bug est reproductible sur votre système local +- Tester les PRs pour s'assurer qu'elles fonctionnent correctement + +Si vous avez choisi de tester si le bug de quelqu'un est reproductible sur votre système local, alors n'hésitez pas à ajouter un commentaire dans le ticket le confirmant avec le résultat de `wails doctor`. + +Pour tester les PR, choisissez une PR et vérifiez si sa description contient les scénarios de test listés. Dans le cas contraire, veuillez demander à la personne qui a ouvert la PR de fournir cette liste. Une fois que vous avez un scénario de test valide, veuillez signaler vos conclusions en commentaire de la PR. + +Si vous avez besoin de plus de clarté ou d'aide lors des tests, veuillez poser une question dans la discussion [Contribuer à Wails](https://github.com/wailsapp/wails/discussions/1520) ou sur slack. + +### Documenter + +Ce site est également la documentation principale du projet. Parfois, elle devient obsolète et nécessite de légers ajustements. Une partie de la documentation n'est pas non plus écrite selon les meilleures normes. Construire une documentation est compliquée, alors toute contribution est grandement appréciée. Sans documentation, les fonctionnalités ne sont pas considérées comme terminées, donc pour le projet c'est _aussi important_ que le code. + +Généralement nous ne créons pas de tickets pour la mise à jour de la documentation. Si vous pensez que quelque chose doit être mis à jour ou réécrit, alors n'hésitez pas à soumettre une PR pour cela. Ce site se trouve dans le dépôt principal sous le répertoire `website`. Nous utilisons [Docusaurus](https://docusaurus.io/) pour créer le site afin qu'il y ait beaucoup de documentation et de tutoriels existants pour aider à l'utiliser. + +Pour mettre en place un environnement de développement local pour la documentation, effectuez les commandes suivantes : + +- [Install npm](https://docs.npmjs.com/cli/v8/configuring-npm/install) +- `cd website` +- `npm install` +- `npm run start` + +Après avoir tout installé et démarré, vous devriez voir le site à l'URL suivante : [`http://localhost:3000`](http://localhost:3000). Toute modification apportée au texte du site sera immédiatement reflétée dans le navigateur. + +#### Gestion de version + +Nous employons un système de gestion de version où nous avons la "dernière" documentation (alias "prochaine version") qui contient toutes les modifications qui ont été faites depuis la dernière version. Et seules les deux versions précédentes de la documentation sont conservées. + +Il n'y a généralement pas de raison de mettre à jour la documentation déjà publiée, alors généralement nous ne mettons pas à jour les documents se trouvant dans les dossiers `versioned_docs` et `versioned_sidebars`. + +La documentation de la "prochaine version" sont principalement dans `website/docs` avec quelques éléments "indépendants des versions" dans `src/pages`. Toute mise à jour doit être effectuée dans le dossier `website/docs`. + +#### Langues + +Par défaut, la documentation de Wails est en anglais. Nous utilisons l'outil "crowdin" pour traduire l'ensemble de la documentation dans d'autres langues et synchroniser le tout sur le site. Vous pouvez [rejoindre notre projet](https://crowdin.com/project/wails) et contribuer en soumettant vos traductions. + +##### Ajouter une nouvelle langue + +Si vous souhaitez ajouter une nouvelle langue à la documentation, veuillez suivre les instructions pour [remplir et soumettre un problème](https://github.com/wailsapp/wails/issues/new?assignees=&labels=documentation&template=documentation.yml). Après avoir été approuvé par le mainteneur, nous ajouterons la langue dans « crowdin » et vous pourrez ensuite soumettre votre traduction. + +### Aider les autres + +Une bonne façon de contribuer au projet est d'aider ceux qui éprouvent des difficultés. Ils ouvrent généralement un ticket ou envoient un message sur le canal Slack de Wails. Même clarifier le problème peut vraiment aider. Parfois, quand un problème est discuté et résolu, nous créons un guide pour aider ceux qui sont confrontés aux mêmes problèmes. + +Pour rejoindre le canal de slack de Wails, acceptez l'invitation [ici](https://gophers.slack.com/join/shared_invite/zt-197vymgt3-sJt4oyakb6nqlVKjXTyeVw#/shared-invite/email) et rejoignez-nous sur le canal en suivant [ce lien](https://gophers.slack.com/?redir=%2Fmessages%2FCJ4P9F7MZ%2F). + +:::note + +Travail en cours + +::: diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx new file mode 100644 index 00000000..7a1d0e2e --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/credits.mdx @@ -0,0 +1,199 @@ +# Crédits + +- [Lea Anthony](https://github.com/leaanthony) - Propriétaire du projet, développeur principal +- [Stffabi](https://github.com/stffabi) - Chef technique, développeur et mainteneur +- [Misite Bao](https://github.com/misitebao) - Sorcier de la documentation, traducteur chinois, testeur pour Windows, découvreur principal de bugs +- [Travis McLane](https://github.com/tmclane) - Travaux de compilation sur plusieurs plateformes, testeur MacOS +- [Byron Chris](https://github.com/bh90210) - Sorcier des distributions Linux, testeur Linux + +## Partenaires + + +## Contributeurs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Lea Anthony

💻 🤔 🎨 🖋 💡 🧑‍🏫 📆 🔧 🐛 📝 🚧 📦 👀 💬 🔬 ⚠️ 📢 👀 📖

stffabi

💻 🤔 🎨 🐛 🚧 📦 👀 💬 🔬 👀 📖 ⚠️

Travis McLane

💻 🔬 📦 🤔 🐛 👀 ⚠️ 💬 📖

Misite Bao

📖 🌍 🔬 🚧

Byron Chris

💻 🔬 🚧 🐛 👀 ⚠️ 💬 🤔 🎨 📦 🚇

konez2k

💻 📦 🤔

Dario Emerson

💻 🐛 🤔 ⚠️

Ian M. Jones

💻 🐛 🤔 ⚠️ 👀 📦

marktohark

💻

Ryan H

💻

Cody Bentley

💻 📦 🤔 💵

Florent

💻 🐛

Alexander Hudek

💻 💵

Tim Kipp

💻

Altynbek Kaliakbarov

💻

Nikolai Zimmermann

💻

k-muchmore

💻

Snider

💻 🤔 📖 💵

Albert Sun

💻 ⚠️

Ariel

💻 🐛

Ilgıt Yıldırım

💻 🐛 💵

Toyam Cox

💻 📦 🐛

hi019

💻 🐛

Arthur Wiebe

💻 🐛

Balakrishna Prasad Ganne

💻

BillBuilt

💻 📦 🤔 💬 💵

Eng Zer Jun

🚧 💻

LGiki

📖

Lontten

📖

Lukas Crepaz

💻 🐛

Marcus Crane

🐛 📖 💵

Qais Patankar

📖

Wakeful-Cloud

💻 🐛

Zámbó, Levente

💻 📦 🐛 ⚠️

Ironpark

💻 🤔

mondy

💻 📖

Benjamin Ryan

🐛

fallendusk

📦 💻

Mat Ryer

💻 🤔 🐛

Abtin

💻 🐛

Adrian Lanzafame

📦 💻

Aleksey Polyakov

🐛 💻

Alexander Matviychuk

💻 📦

AlienRecall

💻 📦

Aman

📖

Amaury Tobias Quiroz

💻 🐛

Andreas Wenk

📖

Antonio Stanković

💻 📦

Arpit Jain

📖

Austin Schey

💻 🐛

Benjamin Thomas

💻 📦 🤔

Bertram Truong

💻 🐛

Blake Bourque

📖

Denis

📖

diogox

💻 📦

Dmitry Gomzyakov

💻 📦

Edward Browncross

💻

Elie Grenon

💻

Florian Didron

💻 🐛 🤔 ⚠️ 👀 📦

GargantuaX

💵

Igor Minin

💻 🐛

Jae-Sung Lee

💻 🤔

Jarek

💻 📦

Junker

📖

Kris Raney

💻 🐛

Luken

📖

Mark Stenglein

💻 🐛

buddyabaddon

💻

MikeSchaap

💻 🐛

NYSSEN Michaël

💻 🐛

Nan0

💻 🤔 ⚠️ 👀

oskar

📖

Pierre Joye

💻 🐛 🤔 ⚠️

Reuben Thomas-Davis

💻 🐛

Robin

💻 🐛

Sebastian Bauer

💻 🤔 ⚠️ 👀 💬

Sidharth Rathi

📖 🐛

Sithembiso Khumalo

💻 🐛

Soheib El-Harrache

💻 🐛 💵

Sophie Au

💻 🐛

Stefanos Papadakis

💻 🐛

Steve Chung

💻 🐛

Timm Ortloff

📖

Tom

💻

Valentin Trinqué

💻 🐛

mattn

💻 🐛

bearsh

💻 🤔 📖

chenxiao

💻 🤔 📖

fengweiqiang

💻 📦

flin7

📖

fred21O4

📖

gardc

📖

rayshoo

📖

Ishiyama Yuzuki

💻 🐛

佰阅

💻

刀刀

📖 🐛

归位

💻 🐛

skamensky

💻 🤔 📖

dependabot[bot]

💻 🚧

Damian Sieradzki

💵

John Dorman

💵

Ian Sinnott

💵

Arden Shackelford

💵

Bironou

💵

CharlieGo_

💵

overnet

💵

jugglingjsons

💵

Selvin Ortiz

💵

ZanderCodes

💵

Michael Voronov

💵

letheanVPN

💵

Tai Groot

💵

easy-web-it

💵

Michael Olson

💵

EdenNetwork Italia

💵

ondoki

💵

QuEST Rail LLC

💵

Gilgameš

💵

Bernt-Johan Bergshaven

💵

Liam Bigelow

💵

Nick Arellano

💵

Frank Chiarulli Jr.

💵

Tyler

💵

Trea Hauet

💵

Kent 'picat' Gruber

💵

tc-hib

💵

Antonio

📖

MyNameIsAres

📖

Maicarons J

📖

kiddov

📖 💵 ⚠️ 🤔

Nicolas Coutin

💵

Parvin Eyvazov

📖
+ + + + + + +## Mentions spéciales + +- [John Chadwick](https://github.com/jchv) - Pour son travail incroyable sur [go-webview2](https://github.com/jchv/go-webview2) et [go-winloader](https://github.com/jchv/go-winloader) qui a permis d'avoir une version Windows. +- [Tad Vizbaras](https://github.com/tadvi) - Son projet winc était la première pierre d'un projet Wails en pure Go. +- [Mat Ryer](https://github.com/matryer) - Pour ses conseils, son support et son humour. +- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - Son support et ses retours ont été inestimables. +- [Justen Walker](https://github.com/justenwalker/) - Pour aider à résoudre les problèmes COM qui ont permis de publier la v2. +- [Wang, Chi](https://github.com/patr0nus/) - Le projet DeskGap a été une grande influence sur la direction de Wails v2. +- [Serge Zaitsev](https://github.com/zserge) - Bien que Wails n'utilise plus le projet Webview, il est toujours une source d'inspiration. diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx b/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx new file mode 100644 index 00000000..ad857468 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/faq.mdx @@ -0,0 +1,9 @@ +# Foire aux questions + +## D'où provient le nom ? + +Quand j'ai vu WebView, j'ai pensé "Ce que je veux vraiment c'est un outil construit autour d'une application WebView, un peu comme Rails l'est pour Ruby". Alors à la base c'était un jeu de mot (**W**ebview on R**ails**). Et il se trouve que c'est un homophone pour le nom anglais du [Pays](https://en.wikipedia.org/wiki/Wales) d'où je viens. Alors c'est resté. + +## Est-ce que c'est une alternative à Electron ? + +Cela dépend de vos besoins. Ça a été conçu pour que les développeurs en Go puissent créer des applications de bureau légères ou pour qu'ils puissent ajouter une interface graphique à leurs applications existantes. Wails v2 offre l'accès à des éléments natifs tels que des menus et des boîtes de dialogues, par conséquent c'est devenu une alternative plus légère à electron. diff --git a/website/i18n/fr/docusaurus-plugin-content-pages/markdown-page.md b/website/i18n/fr/docusaurus-plugin-content-pages/markdown-page.md new file mode 100644 index 00000000..96c90c77 --- /dev/null +++ b/website/i18n/fr/docusaurus-plugin-content-pages/markdown-page.md @@ -0,0 +1,7 @@ +--- +title: Page d'exemple en Markdown +--- + +# Page d'exemple en Markdown + +Vous n'avez pas besoin de React pour écrire de simples pages autonomes. diff --git a/website/i18n/fr/docusaurus-theme-classic/footer.json b/website/i18n/fr/docusaurus-theme-classic/footer.json new file mode 100644 index 00000000..185a249d --- /dev/null +++ b/website/i18n/fr/docusaurus-theme-classic/footer.json @@ -0,0 +1,54 @@ +{ + "link.title.Docs": { + "message": "Documents", + "description": "The title of the footer links column with title=Docs in the footer" + }, + "link.title.Community": { + "message": "Communauté", + "description": "The title of the footer links column with title=Community in the footer" + }, + "link.title.More": { + "message": "En savoir plus", + "description": "The title of the footer links column with title=More in the footer" + }, + "link.item.label.Introduction": { + "message": "Introduction", + "description": "The label of footer link with label=Introduction linking to /docs/introduction" + }, + "link.item.label.Getting Started": { + "message": "Pour démarrer", + "description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation" + }, + "link.item.label.Changelog": { + "message": "Historique des modifications", + "description": "The label of footer link with label=Changelog linking to /changelog" + }, + "link.item.label.Github": { + "message": "GitHub", + "description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails" + }, + "link.item.label.Twitter": { + "message": "Twitter", + "description": "The label of footer link with label=Twitter linking to https://twitter.com/wailsapp" + }, + "link.item.label.Slack": { + "message": "Slack", + "description": "The label of footer link with label=Slack linking to https://gophers.slack.com/messages/CJ4P9F7MZ/" + }, + "link.item.label.Slack invite": { + "message": "Invitation Slack", + "description": "The label of footer link with label=Slack invite linking to https://invite.slack.golangbridge.org/" + }, + "link.item.label.Blog": { + "message": "Blog", + "description": "The label of footer link with label=Blog linking to /blog" + }, + "copyright": { + "message": "Copyright © 2022 Lea Anthony", + "description": "The footer copyright" + }, + "link.item.label.Awesome": { + "message": "Projets basés sur Wails", + "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" + } +} diff --git a/website/i18n/fr/docusaurus-theme-classic/navbar.json b/website/i18n/fr/docusaurus-theme-classic/navbar.json new file mode 100644 index 00000000..27099fc1 --- /dev/null +++ b/website/i18n/fr/docusaurus-theme-classic/navbar.json @@ -0,0 +1,42 @@ +{ + "item.label.Sponsor": { + "message": "Sponsor ❤", + "description": "Navbar item with label Sponsor" + }, + "item.label.Docs": { + "message": "Documents", + "description": "Navbar item with label Docs" + }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, + "item.label.GitHub": { + "message": "GitHub", + "description": "Navbar item with label GitHub" + }, + "item.label.About": { + "message": "À propos", + "description": "Navbar item with label About" + }, + "item.label.FAQ": { + "message": "Foire aux questions", + "description": "Navbar item with label FAQ" + }, + "item.label.Changelog": { + "message": "Historique des modifications", + "description": "Navbar item with label Changelog" + }, + "item.label.Community Guide": { + "message": "Guide communautaire", + "description": "Navbar item with label Community Guide" + }, + "item.label.Credits": { + "message": "Crédits", + "description": "Navbar item with label Credits" + }, + "item.label.Code of Conduct": { + "message": "Code de Conduite", + "description": "Navbar item with label Code of Conduct" + } +} 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 ee434984..05cb24d7 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 @@ -25,8 +25,8 @@ sidebar_position: 1 - [wails-template-vue](https://github.com/misitebao/wails-template-vue) - VueのエコシステムをベースにしたWailsテンプレート (TypeScript、ダークテーマ、i18n、シングルページルーティング、TailwindCSSを統合) - [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Viteを使用したVue 3 TypeScript (および機能を追加する手順) - [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vite、Vuex、Vue Router、SaaS、ESLint + Prettier を使用した Vue 3 TypeScript -- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - A template using JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) -- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - A template using TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API with <script setup>) +- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) を使用したテンプレート +- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, <script setup>によるComposition API) を使用したテンプレート ## Angular diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx index 84c7d5d8..5a698f1a 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx @@ -20,7 +20,7 @@ Wailsをインストールする前に、下記のものを導入しておく必 ### Go -Download Go from the [Go Downloads Page](https://go.dev/dl/). +[Goのダウンロードページ](https://go.dev/dl/)からGoをダウンロードしてください。 公式の[Goインストール手順](https://go.dev/doc/install)に従って、Goをインストールしてください。 その際、`PATH`環境変数に`~/go/bin`ディレクトリへのパスが含まれていることも確認してください。 それらが終わったら、ターミナルを再起動し、以下の確認をしてください: @@ -50,14 +50,13 @@ import TabItem from "@theme/TabItem"; ]} > - Wails requires that the xcode command line tools are installed. This can be - done by running xcode-select --install. + Wailsを使用するには、xcodeのコマンドラインツールがインストールされている必要があります。 xcode-select --installコマンドを実行することでインストールできます。 - Wails requires that the WebView2 runtime is installed. Some Windows installations will already have this installed. You can check using the wails doctor command. + Wailsを使用するには、WebView2ランタイムがインストールされている必要があります。 最新のWindowsでは、すでにインストールされている場合もあります。 wails doctorコマンドで、インストール状況を確認できます。 - Linux required the standard gcc build tools plus libgtk3 and libwebkit. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run wails doctor after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please consult the Add Linux Distro guide. + Linuxでは、標準のgccビルドツール、 libgtk3libwebkitが必要です。 Wailsは、様々なディストリビューション向けに大量のコマンドを列挙することはせず、現在使用されているディストリビューションのインストールコマンドを自動的に判定します。 Wailsをインストールした後に、wails doctorコマンドを実行して、別途インストールが必要な依存関係を確認してください。 あなたが利用しているディストリビューションやパッケージマネージャーがサポートされていない場合は、Linuxディストリビューションサポートガイドを参照してください。 ``` @@ -65,18 +64,18 @@ import TabItem from "@theme/TabItem"; ## 任意の依存関係 - [UPX](https://upx.github.io/)を導入することで、構築したアプリを圧縮できます。 -- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers. +- [NSIS](https://wails.io/docs/guides/windows-installer/)を導入することで、Windowsのインストーラを生成できます。 ## Wailsのインストール `go install github.com/wailsapp/wails/v2/cmd/wails@latest`を実行して、Wails CLIをインストールしてください。 -Note: If you get an error similar to this: +注意: 次のようなエラーが発生した場合: ```shell ....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found ``` -please check you have Go 1.18+ installed: +下記コマンドで、Go 1.18以上がインストールされているかを確認してください: ```shell go version ``` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx index 73173e15..e9c6a27c 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx @@ -1,12 +1,12 @@ -# Dynamic Assets +# 動的アセット -If you want to load or generate assets for your frontend dynamically, you can achieve that using the [AssetsHandler](../reference/options#assetshandler) option. The AssetsHandler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the bundled assets because the file is not found. +[AssetsHandler](../reference/options#assetshandler)オプションを使用することで、フロントエンドアセットを動的に読み込んだり生成させることができます。 AssetsHandlerは、ジェネリックな`http.Handler`です。アセットサーバへのGET以外のすべてのリクエスト、および、アセットファイルとして存在しなかったがために転送されてきたGETリクエストに対して、ハンドラが呼び出されます。 -By installing a custom AssetsHandler, you can serve your own assets using a custom asset server. +カスタムされたAssetsHandlerを導入すると、カスタムアセットサーバを使用して独自のアセットを提供することができます。 -## Example +## 例 -In our example project, we will create a simple assets handler which will load files off disk: +このサンプルプロジェクトでは、ディスクからファイルを読み込むシンプルなアセットハンドラを作成します: ```go title=main.go {16-35,49} package main @@ -47,10 +47,10 @@ func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request) { } func main() { - // Create an instance of the app structure + // App構造体のインスタンスを作成 app := NewApp() - // Create application with options + // オプション付きでアプリケーションを作成 err := wails.Run(&options.App{ Title: "helloworld", Width: 1024, @@ -72,7 +72,7 @@ func main() { } ``` -When we run the application in dev mode using `wails dev`, we will see the following output: +`wails dev`コマンドでアプリケーションを開発モードで実行すると、次のように出力されます: ``` DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' @@ -80,15 +80,15 @@ DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' failed, Requesting file: favicon.ico ``` -As you can see, the assets handler is called when the default assets server is unable to serve the `favicon.ico` file. +これを見ると分かるように、アセットハンドラは、デフォルトのアセットサーバが`favicon.ico`を提供できない場合に呼び出されています。 -If you right click the main application and select "inspect" to bring up the devtools, you can test this feature out by typing the following into the console: +メインアプリケーションをクリックし、"検証(開発者ツールで調査する)"を選択して、開発者ツールを起動します。そして、コンソールに次のように入力して実行することで、機能をテストできます: ``` let response = await fetch('does-not-exist.txt'); ``` -This will generate an error in the devtools. We can see that the error is what we expect, returned by our custom assets handler: +これにより、開発者ツールでエラーが発生します。 カスタムアセットハンドラによって、想定どおりのエラーが返却されていることが分かります。 ```mdx-code-block

@@ -98,7 +98,7 @@ This will generate an error in the devtools. We can see that the error is what w

``` -However, if we request `go.mod`, we will see the following output: +もし、`go.mod`をリクエストした場合は、次のような出力となります: ```mdx-code-block

@@ -106,19 +106,19 @@ However, if we request `go.mod`, we will see the following output:

``` -This technique can be used to load images directly into the page. If we updated our default vanilla template and replaced the logo image: +このテクニックを使用して、ページ上に画像を直接読み込ませることができます。 デフォルトのバニラテンプレートで、ロゴ画像を指定している、下記コードを、 ```html ``` -with: +次のように書き換えます: ```html ``` -Then we would see the following: +すると、画面上は次のような表示となります: ```mdx-code-block

@@ -131,6 +131,6 @@ Then we would see the following: :::warning -Exposing your filesystem in this way is a security risk. It is recommended that you properly manage access to your filesystem. +この例のようにファイルシステムを公開することは、セキュリティ上のリスクとなります。 ファイルシステムへのアクセスは、適切に管理することを推奨します。 ::: diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx index 21f7875e..b3a15b4c 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx @@ -26,7 +26,7 @@ To ensure that your application will work in obfuscated mode, you must use the g ::: -## Example +## 例 Importing the "Greet" method from the bindings like this: 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 73aa5060..527aa641 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 @@ -81,7 +81,7 @@ Example: `wails build -clean -o myproject.exe` :::Info -On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +Macでは、アプリケーションは`Info.dev.plist`ではなく`Info.plist`でバンドルされます。 ::: :::info UPX on Apple Silicon @@ -160,7 +160,7 @@ Your system is ready for Wails development! - 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. +- MacOSでは、アプリケーションを`.app`ファイルにバンドルして実行されます。 開発向けに、`build/darwin/Info.dev.plist`が使用されます。 | Flag | Description | Default | |:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- | @@ -173,7 +173,7 @@ Your system is ready for Wails development! | -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | | | -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | デバッグ | | -noreload | Disable automatic reload when assets change | | -| -nocolour | Turn off colour cli output | false | +| -nocolour | CLIのカラー出力を無効にする | false | | -nogen | Disable generate module | | | -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 | | -wailsjsdir | The directory to generate the generated Wails JS modules | Value in `wails.json` | 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 b6530a83..81fd1950 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 @@ -25,6 +25,7 @@ func main() { Height: 600, DisableResize: false, Fullscreen: false, + WindowStartState: options.Maximised, Frameless: true, MinWidth: 400, MinHeight: 400, @@ -47,7 +48,6 @@ func main() { OnDomReady: app.domready, OnShutdown: app.shutdown, OnBeforeClose: app.beforeClose, - WindowStartState: options.Maximised, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", ZoomFactor: 1.0, @@ -72,11 +72,11 @@ func main() { LightModeTitleText: windows.RGB(20, 20, 20), LightModeBorder: windows.RGB(200, 200, 200), }, - // User messages that can be customised + // ユーザへのメッセージをカスタマイズします Messages *windows.Messages - // OnSuspend is called when Windows enters low power mode + // OnSuspendはWindowsが省電力モードに移行した場合に呼び出されます OnSuspend func() - // OnResume is called when Windows resumes from low power mode + // OnResumeはWindowsが省電力モードから復帰した場合に呼び出されます OnResume func() }, Mac: &mac.Options{ @@ -105,6 +105,7 @@ func main() { OpenInspectorOnStartup: false, }, }) + if err != nil { log.Fatal(err) } @@ -138,9 +139,19 @@ By default, the main window is resizable. Setting this to `true` will keep it a ### Fullscreen -Setting this to `true` will make the window fullscreen at startup. +非推奨: 代わりに[WindowStartState](#windowstartstate)を使用してください。 -名前: Fullscreen
データ型: `bool` +### WindowStartState + +Defines how the window should present itself at startup. + +| 値 | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +名前: WindowStartState
データ型: `options.WindowStartState` ### Frameless @@ -200,19 +211,19 @@ Indicates that the window should stay above other windows when losing focus. ### Assets -Deprecated: Please use Assets on [AssetServer specific options](#assetserver). +非推奨: 代わりに[AssetServerの固有オプション](#assetserver)であるAssetsオプションを使用してください。 ### AssetsHandler -Deprecated: Please use AssetsHandler on [AssetServer specific options](#assetserver). +非推奨: 代わりに[AssetServerの固有オプション](#assetserver)であるAssetsHandlerオプションを使用してください。 ### AssetServer -This defines AssetServer specific options. It allows to customize the AssetServer with static assets, serving assets dynamically with an `http.Handler` or hook into the request chain with an `assetserver.Middleware`. +AssetServerの固有オプションを定義します。 静的なアセットでAssetServerをカスタマイズしたり、`http.Handler`で動的なアセットを提供したり、`assetserver.Middleware`でリクエストチェーンにフックしたりすることができます。 -Not all features of an `http.Request` are currently supported, please see the following feature matrix: +現在のところ、`http.Request`のすべての機能がサポートされているわけではありません。次の機能マトリクスを確認してください: -| Feature | Win | Mac | Lin | +| 機能 | Win | Mac | Lin | | ----------------------- | --- | --- | --- | | GET | ✅ | ✅ | ✅ | | POST | ✅ | ✅ | ❌ | @@ -230,27 +241,26 @@ Not all features of an `http.Request` are currently supported, please see the fo NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support. -Name: AssetServer
Type: `*assetserver.Options` +名前: AssetServer
データ型: `*assetserver.Options` #### Assets -The static frontend assets to be used by the application. +アプリケーションのフロントエンドで使用される静的アセットです。 -A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. +GETリクエストが要求された場合、まず初めに、この`fs.FS`からのアセット提供を試みます。 `fs.FS`から、当該ファイルが存在しない旨の`os.ErrNotExist`エラーが返された場合、このリクエストは[Handler](#handler)へフォールバックされ、ハンドラ側でGETリクエストへの応答を試みます。 -If set to nil, all GET requests will be forwarded to [Handler](#handler). +nilがセットされている場合、GETリクエストに常に[Handler](#handler)へ転送されます。 -Name: Assets
Type: `fs.FS` +名前: Assets
データ型: `fs.FS` #### Handler -The assets handler is a generic `http.Handler` for fallback handling of assets that can't be found. +アセットハンドラは、アセットが見つからなかった場合のフォールバック処理を担う、ジェネリックな`http.Handler`です。 -The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. +[Assets](#assets)内で`os.ErrNotExist`エラーが発生したことにより、アセットを提供できないと判断されたすべてのGETリクエストによって、このハンドラが呼び出されます。 また、GET以外のすべての種類のリクエストは、常にこのハンドラから応答が返されます。 ハンドラが定義されていない状態で、ハンドラが呼び出された場合、次の応答が返されます: -If not defined, the result is the following in cases where the Handler would have been called: -- GET request: `http.StatusNotFound` -- Other request: `http.StatusMethodNotAllowed` +- GETリクエスト: `http.StatusNotFound` +- その他のリクエスト: `http.StatusMethodNotAllowed` NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension. @@ -258,11 +268,11 @@ NOTE: When used in combination with a Frontend DevServer there might be limitati #### Middleware -Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default request handler dynamically, e.g. implement specialized Routing etc. The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default handler used by the AssetServer as an argument. +MiddlewareはHTTPミドルウェアで、AssetServerのリクエストチェーンをフックすることができます。 例えば、特殊なルーティングを実装したいときなど、デフォルトのリクエストハンドラを動的にスキップさせることができます。 Middlewareは、AssetSeverが使用する新しい`http.Handler`を生成するために呼び出されます。引数では、AssetServerがデフォルトで使用するハンドラを受け取ります。 -If not defined, the default AssetServer request chain is executed. +Middlewareが定義されていない場合、デフォルトのAssetServerのリクエストチェーンが実行されます。 -Name: Middleware
Type: `assetserver.Middleware` +名前: Middleware
データ型: `assetserver.Middleware` ### Menu @@ -335,18 +345,6 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { 名前: OnBeforeClose
データ型: `func(ctx context.Context) bool` -### WindowStartState - -Defines how the window should present itself at startup. - -| 値 | Win | Mac | Lin | -| ---------- | --- | --- | --- | -| Fullscreen | ✅ | ✅ | ✅ | -| Maximised | ✅ | ✅ | ✅ | -| Minimised | ✅ | ❌ | ✅ | - -名前: WindowStartState
データ型: `options.WindowStartState` - ### CSSDragProperty ウィンドウをドラッグできる要素を特定するためのCSSプロパティ名を設定します。 デフォルト値: `--wails-draggable` @@ -355,10 +353,22 @@ Defines how the window should present itself at startup. ### CSSDragValue -Indicates what value the `CSSDragProperty` style should have to drag the window. デフォルト値: `drag` +ウィンドウのドラッグを有効にするために、`CSSDragProperty`スタイルが持つべき値を設定します。 デフォルト値: `drag` 名前: CSSDragValue
データ型: `string` +### ZoomFactor + +名前: ZoomFactor
データ型: `float64` + +WebView2の拡大率を定義します。 これは、Edgeのユーザによるズームインまたはズームアウトに対応するオプションです。 + +### IsZoomControlEnabled + +名前: IsZoomControlEnabled
データ型: `bool` + +このオプションを有効にすると、拡大率をユーザによって変更することができます。 拡大率の変更がユーザに許可されていない間は、オプションで拡大率を設定することができますのでご注意ください (例: キオスクアプリケーションなど)。 + ### Bind A slice of struct instances defining methods that need to be bound to the frontend. @@ -437,18 +447,6 @@ Important information about distribution of fixed version runtime: 名前: WebviewBrowserPath
データ型: `string` -### ZoomFactor - -Name: ZoomFactor
Type: `float64` - -This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. - -### IsZoomControlEnabled - -Name: IsZoomControlEnabled
Type: `bool` - -This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar). - #### Theme Minimum Windows Version: Windows 10 2004/20H1 @@ -583,7 +581,7 @@ type TitleBar struct { Preconfigured titlebar settings are available: -| Setting | Example | +| Setting | 例 | | --------------------------- | ---------------------------------------------- | | `mac.TitleBarDefault()` | ![](/img/reference/titlebar-default.webp) | | `mac.TitleBarHidden()` | ![](/img/reference/titlebar-hidden.webp) | @@ -721,18 +719,18 @@ The icon should be provided in whatever size it was naturally drawn; that is, do #### WindowIsTranslucent -Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window. +Setting this to `true` will make the window background translucent. ウィンドウマネージャによっては、この設定を無視したり、ブラックウィンドウになる場合があります。 名前: WindowIsTranslucent
データ型: `bool` ### デバッグ -This defines [Debug specific options](#Debug) that apply to debug builds. +デバッグビルド時に適用される[デバッグ固有のオプション](#Debug)を定義します。 -Name: Debug
Type: `options.Debug` +名前: Debug
データ型: `options.Debug` #### OpenInspectorOnStartup -Setting this to `true` will open the WebInspector on startup of the application. +このオプションを`true`に設定すると、アプリケーション起動時にWeb開発者ツールが表示されます。 -Name: OpenInspectorOnStartup
Type: `bool` +名前: OpenInspectorOnStartup
データ型: `bool` 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 f573a4ad..b1bb7a63 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 @@ -8,10 +8,10 @@ The project config resides in the `wails.json` file in the project directory. Th ```json { - "name": "[The project name]", - "assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]", - "reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]", - "build:dir": "[The directory where the build files reside. Defaults to 'build']", + "name": "[プロジェクト名。]", + "assetdir": "[コンパイルされたアセットディレクトリへの相対パス。通常は自動的に推測されるため、空で構いません。]", + "reloaddirs": "[再読み込みのトリガーとなる追加のディレクトリ(カンマ区切り)。高度なアセット構成をとる場合にのみ使用します。]", + "build:dir": "[ビルドファイルが存在するディレクトリ。 Defaults to 'build']", "frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']", "frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]", "frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]", @@ -54,4 +54,4 @@ This file is read by the Wails CLI when running `wails build` or `wails dev`. The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs. -The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json). +このファイルのJSONスキーマは、[こちら](https://wails.io/schemas/config.v2.json)にあります。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx index 997acad0..35ff1f34 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx @@ -123,14 +123,14 @@ type MessageDialogOptions struct { | Title | ダイアログのタイトル | ✅ | ✅ | ✅ | | Message | ユーザに表示するメッセージ | ✅ | ✅ | ✅ | | Buttons | ボタンテキストのリスト | | ✅ | | -| DefaultButton | 指定されたテキストのボタンをデフォルトボタンとして扱う。 Bound to `return`. | ✅[*](#windows) | ✅ | | +| DefaultButton | 指定されたテキストのボタンをデフォルトボタンとして扱う。 `return`キーにバインドされます。 | ✅[*](#windows) | ✅ | | | CancelButton | 指定されたテキストのボタンをキャンセルボタンとして扱う。 `escape`キーにバインドされます。 | | ✅ | | #### Windows -Windowsでは、ボタンのカスタマイズができない標準ダイアログタイプがあります。 The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue". +Windowsでは、ボタンのカスタマイズができない標準ダイアログタイプがあります。 返却される値は次のいずれかとなります: "Ok"、"Cancel"、"Abort"、"Retry"、"Ignore"、"Yes"、"No"、"Try Again"、"Continue"。 -For Question dialogs, the default button is "Yes" and the cancel button is "No". This can be changed by setting the `DefaultButton` value to `"No"`. +質問ダイアログの場合、デフォルトボタンは"Yes"、キャンセルボタンは"No"となります。 この設定は、`DefaultButton`の値を`"No"`にすることで、変更できます。 Example: ```go diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx index 59d19e3a..67e35cf6 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx @@ -8,7 +8,7 @@ Wailsでは、GoまたはJavascriptによって発行および受信できる、 ### EventsOn -このメソッドは、指定されたイベント名のイベントリスナーを新たに設定します。 `eventName`という名前のイベントが[発行](#EventsEmit)されると、コールバックがトリガーされます。 イベント発行時にデータも付与されていた場合、そのデータはコールバックに渡されます。 It returns a function to cancel the listener. +このメソッドは、指定されたイベント名のイベントリスナーを新たに設定します。 `eventName`という名前のイベントが[発行](#EventsEmit)されると、コールバックがトリガーされます。 イベント発行時にデータも付与されていた場合、そのデータはコールバックに渡されます。 このメソッドは、リスナーをキャンセルするための関数を返します。 Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void` @@ -20,13 +20,13 @@ Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...st ### EventsOnce -このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、一度だけトリガーさせます。 It returns a function to cancel the listener. +このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、一度だけトリガーさせます。 このメソッドは、リスナーをキャンセルするための関数を返します。 Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void` ### EventsOnMultiple -このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、最大`counter`回だけトリガーします。 It returns a function to cancel the listener. +このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、最大`counter`回だけトリガーします。 このメソッドは、リスナーをキャンセルするための関数を返します。 Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`
JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void` diff --git a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx index 49e6a113..9abfdf96 100644 --- a/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/ja/docusaurus-plugin-content-pages/changelog.mdx @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081) +- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103) ## v2.2.0 - 2022-11-09 diff --git a/website/i18n/ko/code.json b/website/i18n/ko/code.json index c8410007..94828618 100644 --- a/website/i18n/ko/code.json +++ b/website/i18n/ko/code.json @@ -1,37 +1,37 @@ { "homepage.Features.Title1": { - "message": "homepage.Features.Title1" + "message": "풍부한 기능" }, "homepage.Features.Description1": { - "message": "homepage.Features.Description1" + "message": "메뉴, 대화상자 등과 같은 네이티브 UI 요소를 사용하여 크로스 플랫폼 애플리케이션을 빌드하세요." }, "homepage.Features.Title2": { - "message": "homepage.Features.Title2" + "message": "친숙함" }, "homepage.Features.Description2": { - "message": "homepage.Features.Description2" + "message": "이미 알고 있는 기술로 멋진 애플리케이션을 빌드하세요." }, "homepage.Features.Title3": { - "message": "homepage.Features.Title3" + "message": "빠른 구성" }, "homepage.Features.Description3": { - "message": "homepage.Features.Description3" + "message": "Wails CLI를 사용하여 프로젝트를 빠르게 생성, 빌드 및 패키징할 수 있습니다." }, "homepage.Tagline": { - "message": "homepage.Tagline" - }, - "homepage.LearnMoreButtonText": { - "message": "homepage.LearnMoreButtonText" + "message": "Go에서 아름다운 크로스 플랫폼 애플리케이션 빌드" }, "homepage.ButtonText": { - "message": "homepage.ButtonText" + "message": "시작하기" + }, + "homepage.LearnMoreButtonText": { + "message": "자세히 보기" }, "theme.ErrorPageContent.title": { - "message": "페이지에 오류가 발생하였습니다.", + "message": "페이지가 충돌했습니다.", "description": "The title of the fallback page when the page crashed" }, "theme.ErrorPageContent.tryAgain": { - "message": "다시 시도해 보세요", + "message": "재시도", "description": "The label of the button to try again when the page crashed" }, "theme.NotFound.title": { @@ -39,15 +39,269 @@ "description": "The title of the 404 page" }, "theme.NotFound.p1": { - "message": "원하는 페이지를 찾을 수 없습니다.", + "message": "요청한 페이지를 찾을 수 없습니다.", "description": "The first paragraph of the 404 page" }, "theme.NotFound.p2": { - "message": "사이트 관리자에게 링크가 깨진 것을 알려주세요.", + "message": "원래 URL에 연결한 사이트의 소유자에게 연락하여 링크가 깨졌음을 알려주세요.", "description": "The 2nd paragraph of the 404 page" }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "닫기", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.archive.title": { + "message": "아카이브", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "아카이브", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "맨위로", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "블로그 목록 페이지 탐색", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "최근 글", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "이전 글", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.readingTime.plurals": { + "message": "1분 읽기|{readingTime} 분 읽기", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.post.readMoreLabel": { + "message": "{title} 에 대하여 더 읽기", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readMore": { + "message": "더 읽어보기", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "블로그 글 페이지 탐색", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "최근 글", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "이전 글", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "블로그 최근 글 탐색", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.blog.post.plurals": { + "message": "1개 게시글|{count} 개 게시글", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "\"{tagName}\" 태그가 붙은 {nPosts} 개의 글", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "모든 태그 보기", + "description": "The label of the link targeting the tag list page" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "클립보드에 코드 복사", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copied": { + "message": "복사됨", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copy": { + "message": "복사", + "description": "The copy button label on code blocks" + }, + "theme.colorToggle.ariaLabel": { + "message": "다크모드와 라이트 모드 전환하기 (현재 {mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "다크 모드", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "라이트 모드", + "description": "The name for the light color mode" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count}개 항목", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "사이드바 확장", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "사이드바 확장", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "문서 페이지 탐색", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "이전", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "다음", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "사이드바 접기", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "사이드바 접기", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "'{label}' 카테고리 사이드바 토글", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "태그된 문서 1개|{count}개의 문서가 태그됨", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "\"{tagName}\" 태그가 붙은 {nDocsTagged}개의 문서", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "버전: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "{siteTitle} {versionLabel} 문서는 아직 정식 공개되지 않았습니다.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "이 문서는 {siteTitle} {versionLabel} 버전에 관한 문서이며, 더 이상 유지보수되지 않습니다.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "최신 문서는 {latestVersionLink} ({versionLabel})을 확인하세요.", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "최신 버전", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "이 페이지 편집하기", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "제목으로 바로 가기", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " 작성일: {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " 작성자: {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "최근 업데이트: {atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← 메인 메뉴로 돌아가기", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "버전", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.common.skipToMainContent": { + "message": "메인 콘텐츠로 건너뛰기", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsListLabel": { + "message": "태그:", + "description": "The label alongside a tag list" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "이 페이지", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "언어", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.SearchBar.seeAll": { + "message": "{count}개의 결과 모두 보기" + }, + "theme.SearchBar.label": { + "message": "검색", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "{count}개의 문서를 찾았습니다.", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "\"{query}\"에 대한 검색 결과", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "문서 검색", + "description": "The search page title for empty query" + }, + "theme.SearchPage.inputPlaceholder": { + "message": "검색어를 입력하세요.", + "description": "The placeholder for search page input" + }, + "theme.SearchPage.inputLabel": { + "message": "검색", + "description": "The ARIA label for search page input" + }, + "theme.SearchPage.algoliaLabel": { + "message": "Algolia에 의해 검색", + "description": "The ARIA label for Algolia mention" + }, + "theme.SearchPage.noResultsText": { + "message": "검색 결과가 없습니다.", + "description": "The paragraph for empty search result" + }, + "theme.SearchPage.fetchingNewResults": { + "message": "새로운 검색 결과를 불러오는 중 입니다...", + "description": "The paragraph for fetching new search results" + }, + "theme.tags.tagsPageTitle": { + "message": "태그", + "description": "The title of the tag list page" + }, + "theme.docs.breadcrumbs.home": { + "message": "홈페이지", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "탐색 경로", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "줄 바꿈 전환", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, "theme.admonition.note": { - "message": "노트", + "message": "참고", "description": "The default label used for the Note admonition (:::note)" }, "theme.admonition.tip": { @@ -66,258 +320,8 @@ "message": "주의", "description": "The default label used for the Caution admonition (:::caution)" }, - "theme.BackToTopButton.buttonAriaLabel": { - "message": "맨 위로 스크롤하기", - "description": "The ARIA label for the back to top button" - }, - "theme.blog.archive.title": { - "message": "게시물 목록", - "description": "The page & hero title of the blog archive page" - }, - "theme.blog.archive.description": { - "message": "게시물 목록", - "description": "The page & hero description of the blog archive page" - }, - "theme.blog.paginator.navAriaLabel": { - "message": "블로그 게시물 목록 탐색", - "description": "The ARIA label for the blog pagination" - }, - "theme.blog.paginator.newerEntries": { - "message": "이전 페이지", - "description": "The label used to navigate to the newer blog posts page (previous page)" - }, - "theme.blog.paginator.olderEntries": { - "message": "다음 페이지", - "description": "The label used to navigate to the older blog posts page (next page)" - }, - "theme.blog.post.paginator.navAriaLabel": { - "message": "블로그 게시물 탐색", - "description": "The ARIA label for the blog posts pagination" - }, - "theme.blog.post.paginator.newerPost": { - "message": "이전 게시물", - "description": "The blog post button label to navigate to the newer/previous post" - }, - "theme.blog.post.paginator.olderPost": { - "message": "다음 게시물", - "description": "The blog post button label to navigate to the older/next post" - }, - "theme.blog.post.plurals": { - "message": "{count}개 게시물", - "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.blog.tagTitle": { - "message": "\"{tagName}\" 태그로 연결된 {nPosts}개의 게시물이 있습니다.", - "description": "The title of the page for a blog tag" - }, - "theme.tags.tagsPageLink": { - "message": "모든 태그 보기", - "description": "The label of the link targeting the tag list page" - }, - "theme.colorToggle.ariaLabel": { - "message": "어두운 모드와 밝은 모드 전환하기 (현재 {mode})", - "description": "The ARIA label for the navbar color mode toggle" - }, - "theme.colorToggle.ariaLabel.mode.dark": { - "message": "어두운 모드", - "description": "The name for the dark color mode" - }, - "theme.colorToggle.ariaLabel.mode.light": { - "message": "밝은 모드", - "description": "The name for the light color mode" - }, - "theme.docs.breadcrumbs.home": { - "message": "홈", - "description": "The ARIA label for the home page in the breadcrumbs" - }, - "theme.docs.breadcrumbs.navAriaLabel": { - "message": "Breadcrumbs", - "description": "The ARIA label for the breadcrumbs" - }, - "theme.docs.DocCard.categoryDescription": { - "message": "{count} 항목", - "description": "The default description for a category card in the generated index about how many items this category includes" - }, - "theme.docs.paginator.navAriaLabel": { - "message": "문서 탐색", - "description": "The ARIA label for the docs pagination" - }, - "theme.docs.paginator.previous": { - "message": "이전", - "description": "The label used to navigate to the previous doc" - }, - "theme.docs.paginator.next": { - "message": "다음", - "description": "The label used to navigate to the next doc" - }, - "theme.docs.tagDocListPageTitle.nDocsTagged": { - "message": "{count}개 문서가", - "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.tagDocListPageTitle": { - "message": "{nDocsTagged} \"{tagName}\" 태그에 분류되었습니다", - "description": "The title of the page for a docs tag" - }, - "theme.docs.versionBadge.label": { - "message": "버전: {versionLabel}" - }, - "theme.docs.versions.unreleasedVersionLabel": { - "message": "{siteTitle} {versionLabel} 문서는 아직 정식 공개되지 않았습니다.", - "description": "The label used to tell the user that he's browsing an unreleased doc version" - }, - "theme.docs.versions.unmaintainedVersionLabel": { - "message": "{siteTitle} {versionLabel} 문서는 더 이상 업데이트되지 않습니다.", - "description": "The label used to tell the user that he's browsing an unmaintained doc version" - }, - "theme.docs.versions.latestVersionSuggestionLabel": { - "message": "최신 문서는 {latestVersionLink} ({versionLabel})을 확인하세요.", - "description": "The label used to tell the user to check the latest version" - }, - "theme.docs.versions.latestVersionLinkLabel": { - "message": "최신 버전", - "description": "The label used for the latest version suggestion link label" - }, - "theme.common.editThisPage": { - "message": "페이지 편집", - "description": "The link label to edit the current page" - }, - "theme.common.headingLinkTitle": { - "message": "제목으로 바로 가기", - "description": "Title for link to heading" - }, - "theme.lastUpdated.atDate": { - "message": " {date}에", - "description": "The words used to describe on which date a page has been last updated" - }, - "theme.lastUpdated.byUser": { - "message": " {user}가", - "description": "The words used to describe by who the page has been last updated" - }, - "theme.lastUpdated.lastUpdatedAtBy": { - "message": "최종 수정: {atDate}{byUser}", - "description": "The sentence used to display when a page has been last updated, and by who" - }, - "theme.navbar.mobileVersionsDropdown.label": { - "message": "버전", - "description": "The label for the navbar versions dropdown on mobile view" - }, - "theme.common.skipToMainContent": { - "message": "본문으로 건너뛰기", - "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" - }, - "theme.tags.tagsListLabel": { - "message": "태그:", - "description": "The label alongside a tag list" - }, - "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "닫기", - "description": "The ARIA label for close button of announcement bar" - }, - "theme.blog.sidebar.navAriaLabel": { - "message": "최근 블로그 문서 둘러보기", - "description": "The ARIA label for recent posts in the blog sidebar" - }, - "theme.CodeBlock.copied": { - "message": "복사했습니다", - "description": "The copied button label on code blocks" - }, - "theme.CodeBlock.copyButtonAriaLabel": { - "message": "클립보드에 코드 복사", - "description": "The ARIA label for copy code blocks button" - }, - "theme.CodeBlock.copy": { - "message": "복사", - "description": "The copy button label on code blocks" - }, - "theme.CodeBlock.wordWrapToggle": { - "message": "줄 바꿈 전환", - "description": "The title attribute for toggle word wrapping button of code block lines" - }, - "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { - "message": "접을 수 있는 사이드바 분류 '{label}' 접기(펼치기)", - "description": "The ARIA label to toggle the collapsible sidebar category" - }, - "theme.navbar.mobileLanguageDropdown.label": { - "message": "언어", - "description": "The label for the mobile language switcher dropdown" - }, - "theme.TOCCollapsible.toggleButtonLabel": { - "message": "이 페이지에서", - "description": "The label used by the button on the collapsible TOC component" - }, - "theme.blog.post.readMore": { - "message": "자세히 보기", - "description": "The label used in blog post item excerpts to link to full blog posts" - }, - "theme.blog.post.readMoreLabel": { - "message": "{title} 에 대해 더 읽어보기", - "description": "The ARIA label for the link to full blog posts from excerpts" - }, - "theme.blog.post.readingTime.plurals": { - "message": "약 {readingTime}분", - "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.sidebar.collapseButtonTitle": { - "message": "사이드바 숨기기", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.docs.sidebar.collapseButtonAriaLabel": { - "message": "사이드바 숨기기", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { - "message": "← 메인 메뉴로 돌아가기", - "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" - }, - "theme.docs.sidebar.expandButtonTitle": { - "message": "사이드바 열기", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.docs.sidebar.expandButtonAriaLabel": { - "message": "사이드바 열기", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.SearchBar.seeAll": { - "message": "{count}개의 결과 확인하기" - }, - "theme.SearchPage.documentsFound.plurals": { - "message": "{count}개의 문서를 찾았습니다.", - "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.SearchPage.existingResultsTitle": { - "message": "\"{query}\" 검색 결과", - "description": "The search page title for non-empty query" - }, - "theme.SearchPage.emptyResultsTitle": { - "message": "문서를 검색합니다.", - "description": "The search page title for empty query" - }, - "theme.SearchPage.inputPlaceholder": { - "message": "검색어를 입력하세요.", - "description": "The placeholder for search page input" - }, - "theme.SearchPage.inputLabel": { - "message": "검색", - "description": "The ARIA label for search page input" - }, - "theme.SearchPage.algoliaLabel": { - "message": "Algolia로 검색", - "description": "The ARIA label for Algolia mention" - }, - "theme.SearchPage.noResultsText": { - "message": "검색 결과가 없습니다.", - "description": "The paragraph for empty search result" - }, - "theme.SearchPage.fetchingNewResults": { - "message": "새로운 검색 결과를 불러오는 중입니다.", - "description": "The paragraph for fetching new search results" - }, - "theme.SearchBar.label": { - "message": "검색", - "description": "The ARIA label and placeholder for search button" - }, "theme.SearchModal.searchBox.resetButtonTitle": { - "message": "검색어 초기화", + "message": "쿼리 초기화", "description": "The label and ARIA label for search box reset button" }, "theme.SearchModal.searchBox.cancelButtonText": { @@ -333,11 +337,11 @@ "description": "The text when no recent searches" }, "theme.SearchModal.startScreen.saveRecentSearchButtonTitle": { - "message": "이 검색어를 저장", + "message": "검색어 저장", "description": "The label for save recent search button" }, "theme.SearchModal.startScreen.removeRecentSearchButtonTitle": { - "message": "이 검색어를 최근 검색어에서 삭제", + "message": "히스토리에서 이 검색 지우기", "description": "The label for remove recent search button" }, "theme.SearchModal.startScreen.favoriteSearchesTitle": { @@ -345,7 +349,7 @@ "description": "The title for favorite searches" }, "theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": { - "message": "이 검색어를 즐겨찾기에서 삭제", + "message": "즐겨찾기에서 이 검색 지우기", "description": "The label for remove favorite search button" }, "theme.SearchModal.errorScreen.titleText": { @@ -353,7 +357,7 @@ "description": "The title for error screen of search modal" }, "theme.SearchModal.errorScreen.helpText": { - "message": "인터넷 연결을 다시 확인하시기 바랍니다.", + "message": "인터넷 연결을 확인하세요.", "description": "The help text for error screen of search modal" }, "theme.SearchModal.footer.selectText": { @@ -361,7 +365,7 @@ "description": "The explanatory text of the action for the enter key" }, "theme.SearchModal.footer.selectKeyAriaLabel": { - "message": "엔터 키", + "message": "키 입력", "description": "The ARIA label for the Enter key button that makes the selection" }, "theme.SearchModal.footer.navigateText": { @@ -397,19 +401,15 @@ "description": "The text for the suggested query when no results are found for the following search" }, "theme.SearchModal.noResultsScreen.reportMissingResultsText": { - "message": "검색 결과가 없는 것이 오류라고 생각되십니까?", + "message": "검색 결과가 없는 것이 오류라고 생각되나요?", "description": "The text for the question where the user thinks there are missing results" }, "theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": { - "message": "알려주시기 바랍니다.", + "message": "저희에게 알려주세요!", "description": "The text for the link to report missing results" }, "theme.SearchModal.placeholder": { "message": "문서 검색", "description": "The placeholder of the input of the DocSearch pop-up modal" - }, - "theme.tags.tagsPageTitle": { - "message": "태그", - "description": "The title of the tag list page" } } diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx b/website/i18n/ko/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx new file mode 100644 index 00000000..28201766 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx @@ -0,0 +1,161 @@ +--- +slug: wails-v2-beta-for-windows +title: Wails v2 Beta for Windows +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +

+ +
+
+``` + +When I first announced Wails on Reddit, just over 2 years ago from a train in Sydney, I did not expect it to get much attention. A few days later, a prolific tech vlogger released a tutorial video, gave it a positive review and from that point on, interest in the project has skyrocketed. + +It was clear that people were excited about adding web frontends to their Go projects, and almost immediately pushed the project beyond the proof of concept that I had created. At the time, Wails used the [webview](https://github.com/webview/webview) project to handle the frontend, and the only option for Windows was the IE11 renderer. Many bug reports were rooted in this limitation: poor JavaScript/CSS support and no dev tools to debug it. This was a frustrating development experience but there wasn't much that could have been done to rectify it. + +For a long time, I'd firmly believed that Microsoft would eventually have to sort out their browser situation. The world was moving on, frontend development was booming and IE wasn't cutting it. When Microsoft announced the move to using Chromium as the basis for their new browser direction, I knew it was only a matter of time until Wails could use it, and move the Windows developer experience to the next level. + +Today, I am pleased to announce: **Wails v2 Beta for Windows**! There's a huge amount to unpack in this release, so grab a drink, take a seat and we'll begin... + +### No CGO Dependency! + +No, I'm not joking: _No_ _CGO_ _dependency_ 🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path. + +### WebView2 Chromium Renderer + +```mdx-code-block +
+ +
+
+``` + +Finally, Windows developers get a first class rendering engine for their applications! Gone are the days of contorting your frontend code to work on Windows. On top of that, you get a first-class developer tools experience! + +The WebView2 component does, however, have a requirement to have the `WebView2Loader.dll` sitting alongside the binary. This makes distribution just that little bit more painful than we gophers are used to. All solutions and libraries (that I know of) that use WebView2 have this dependency. + +However, I'm really excited to announce that Wails applications _have no such requirement_! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk. + +Gophers rejoice! The single binary dream lives on! + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +There is now the option to generate IDE configuration along with your project. This means that if you open your project in a supported IDE, it will already be configured for building and debugging your application. Currently VSCode is supported but we hope to support other IDEs such as Goland soon. + +```mdx-code-block +
+ +
+
+``` + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +```mdx-code-block +
+ +
+
+``` + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### In Conclusion + +Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome. Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +There were many twists and turns, pivots and u-turns to get to this point. This was due partly to early technical decisions that needed changing, and partly because some core problems we had spent time building workarounds for were fixed upstream: Go’s embed feature is a good example. Fortunately, everything came together at the right time, and today we have the very best solution that we can have. I believe the wait has been worth it - this would not have been possible even 2 months ago. + +I also need to give a huge thank you :pray: to the following people because without them, this release just wouldn't exist: + +- [Misite Bao](https://github.com/misitebao) - An absolute workhorse on the Chinese translations and an incredible bug finder. +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version we have today possible. +- [Tad Vizbaras](https://github.com/tadvi) - Experimenting with his [winc](https://github.com/tadvi/winc) project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - His support, encouragement and feedback has really helped drive the project forward. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: MacOS and Linux users need not feel left out - porting to this new foundation is actively under way and most of the hard work has already been done. Hang in there! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx b/website/i18n/ko/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx new file mode 100644 index 00000000..76ae8c80 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx @@ -0,0 +1,170 @@ +--- +slug: wails-v2-beta-for-mac +title: Wails v2 Beta for MacOS +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Today marks the first beta release of Wails v2 for Mac! It's taken quite a while to get to this point and I'm hoping that today's release will give you something that's reasonably useful. There have been a number of twists and turns to get to this point and I'm hoping, with your help, to iron out the crinkles and get the Mac port polished for the final v2 release. + +You mean this isn't ready for production? For your use case, it may well be ready, but there are still a number of known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would like to contribute, you'd be very welcome! + +So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### Mac Specific Options + +In addition to the normal application options, Wails v2 for Mac also brings some Mac extras: + +- Make your window all funky and translucent, like all the pretty swift apps! +- Highly customisable titlebar +- We support the NSAppearance options for the application +- Simple config to auto-create an "About" menu + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Native M1 Support + +Thanks to the amazing support of [Mat Ryer](https://github.com/matryer/), the Wails project now supports M1 native builds: + +```mdx-code-block +
+ +
+
+``` + +You can also specify `darwin/amd64` as a target too: + +```mdx-code-block +
+ +
+
+``` + +Oh, I almost forgot.... you can also do `darwin/universal`.... :wink: + +```mdx-code-block +
+ +
+
+``` + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### WKWebView Renderer + +V1 relied on a (now deprecated) WebView component. V2 uses the most recent WKWebKit component so expect the latest and greatest from Apple. + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: Linux users, you're next! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx b/website/i18n/ko/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx new file mode 100644 index 00000000..eb7f2a46 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx @@ -0,0 +1,114 @@ +--- +slug: wails-v2-beta-for-linux +title: Wails v2 Beta for Linux +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +I'm pleased to finally announce that Wails v2 is now in beta for Linux! It is somewhat ironic that the very first experiments with v2 was on Linux and yet it has ended up as the last release. That being said, the v2 we have today is very different from those first experiments. So without further ado, let's go over the new features: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +Linux is **hard** to support. We expect there to be a number of quirks with the beta. Please help us to help you by filing detailed bug reports! + +Finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors) whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: The v2 release isn't far off now! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx b/website/i18n/ko/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx new file mode 100644 index 00000000..e9d570af --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx @@ -0,0 +1,98 @@ +--- +slug: wails-v2-released +title: Wails v2 Released +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +# It's here! + +Today marks the release of [Wails](https://wails.io) v2. It's been about 18 months since the first v2 alpha and about a year from the first beta release. I'm truly grateful to everyone involved in the evolution of the project. + +Part of the reason it took that long was due to wanting to get to some definition of completeness before officially calling it v2. The truth is, there's never a perfect time to tag a release - there's always outstanding issues or "just one more" feature to squeeze in. What tagging an imperfect major release does do, however, is to provide a bit of stability for users of the project, as well as a bit of a reset for the developers. + +This release is more than I'd ever expected it to be. I hope it gives you as much pleasure as it has given us to develop it. + +# What _is_ Wails? + +If you are unfamiliar with Wails, it is a project that enables Go programmers to provide rich frontends for their Go programs using familiar web technologies. It's a lightweight, Go alternative to Electron. Much more information can be found on the [official site](https://wails.io/docs/introduction). + +# What's new? + +The v2 release is a huge leap forward for the project, addressing many of the pain points of v1. If you have not read any of the blog posts on the Beta releases for [macOS](/blog/wails-v2-beta-for-mac), [Windows](/blog/wails-v2-beta-for-windows) or [Linux](/blog/wails-v2-beta-for-linux), then I encourage you to do so as it covers all the major changes in more detail. In summary: + +- Webview2 component for Windows that supports modern web standards and debugging capabilities. +- [Dark / Light theme](/docs/reference/options#theme) + [custom theming](/docs/reference/options#customtheme) on Windows. +- Windows now has no CGO requirements. +- Out-of-the-box support for Svelte, Vue, React, Preact, Lit & Vanilla project templates. +- [Vite](https://vitejs.dev/) integration providing a hot-reload development environment for your application. +- Native application [menus](/docs/guides/application-development#application-menu) and [dialogs](/docs/reference/runtime/dialog). +- Native window translucency effects for [Windows](/docs/reference/options#windowistranslucent) and [macOS](/docs/reference/options#windowistranslucent-1). Support for Mica & Acrylic backdrops. +- Easily generate an [NSIS installer](/docs/guides/windows-installer) for Windows deployments. +- A rich [runtime library](/docs/reference/runtime/intro) providing utility methods for window manipulation, eventing, dialogs, menus and logging. +- Support for [obfuscating](/docs/guides/obfuscated) your application using [garble](https://github.com/burrowers/garble). +- Support for compressing your application using [UPX](https://upx.github.io/). +- Automatic Typescript generation of Go structs. More info [here](/docs/howdoesitwork#calling-bound-go-methods). +- No extra libraries or DLLs are required to be shipped with your application. For any platform. +- No requirement to bundle frontend assets. Just develop your application like any other web application. + +# Credit & Thanks + +Getting to v2 has been a huge effort. There have been ~2.2K commits by 89 contributors between the initial alpha and the release today, and many, many more that have provided translations, testing, feedback and help on the discussion forums as well as the issue tracker. I'm so unbelievably grateful to each one of you. I'd also like to give an extra special thank you to all the project sponsors who have provided guidance, advice and feedback. Everything you do is hugely appreciated. + +There are a few people I'd like to give special mention to: + +Firstly, a **huge** thank you to [@stffabi](https://github.com/stffabi) who has provided so many contributions which we all benefit from, as well as providing a lot of support on many issues. He has provided some key features such as the external dev server support which transformed our dev mode offering by allowing us to hook into [Vite](https://vitejs.dev/)'s superpowers. It's fair to say that Wails v2 would be a far less exciting release without his [incredible contributions](https://github.com/wailsapp/wails/commits?author=stffabi&since=2020-01-04). Thank you so much @stffabi! + +I'd also like to give a huge shout-out to [@misitebao](https://github.com/misitebao) who has tirelessly been maintaining the website, as well as providing Chinese translations, managing Crowdin and helping new translators get up to speed. This is a hugely important task, and I'm extremely grateful for all the time and effort put into this! You rock! + +Last, but not least, a huge thank you to Mat Ryer who has provided advice and support during the development of v2. Writing xBar together using an early Alpha of v2 was helpful in shaping the direction of v2, as well as give me an understanding of some design flaws in the early releases. I'm happy to announce that as of today, we will start to port xBar to Wails v2, and it will become the flagship application for the project. Cheers Mat! + +# Lessons Learnt + +There are a number of lessons learnt in getting to v2 that will shape development moving forward. + +## Smaller, Quicker, Focused Releases + +In the course of developing v2, there were many features and bug fixes that were developed on an ad-hoc basis. This led to longer release cycles and were harder to debug. Moving forward, we are going to create releases more often that will include a reduced number of features. A release will involve updates to documentation as well as thorough testing. Hopefully, these smaller, quicker, focussed releases will lead to fewer regressions and better quality documentation. + +## Encourage Engagement + +When starting this project, I wanted to immediately help everyone who had a problem. Issues were "personal" and I wanted them resolved as quickly as possible. This is unsustainable and ultimately works against the longevity of the project. Moving forward, I will be giving more space for people to get involved in answering questions and triaging issues. It would be good to get some tooling to help with this so if you have any suggestions, please join in the discussion [here](https://github.com/wailsapp/wails/discussions/1855). + +## Learning to say No + +The more people that engage with an Open Source project, the more requests there will be for additional features that may or may not be useful to the majority of people. These features will take an initial amount of time to develop and debug, and incur an ongoing maintenance cost from that point on. I myself am the most guilty of this, often wanting to "boil the sea" rather than provide the minimum viable feature. Moving forward, we will need to say "No" a bit more to adding core features and focus our energies on a way to empower developers to provide that functionality themselves. We are looking seriously into plugins for this scenario. This will allow anyone to extend the project as they see fit, as well as providing an easy way to contribute towards the project. + +# Looking to the Future + +There are so many core features we are looking at to add to Wails in the next major development cycle already. The [roadmap](https://github.com/wailsapp/wails/discussions/1484) is full of interesting ideas, and I'm keen to start work on them. One of the big asks has been for multiple window support. It's a tricky one and to do it right, and we may need to look at providing an alternative API, as the current one was not designed with this in mind. Based on some preliminary ideas and feedback, I think you'll like where we're looking to go with it. + +I'm personally very excited at the prospect of getting Wails apps running on mobile. We already have a demo project showing that it is possible to run a Wails app on Android, so I'm really keen to explore where we can go with this! + +A final point I'd like to raise is that of feature parity. It has long been a core principle that we wouldn't add anything to the project without there being full cross-platform support for it. Whilst this has proven to be (mainly) achievable so far, it has really held the project back in releasing new features. Moving forward, we will be adopting a slightly different approach: any new feature that cannot be immediately released for all platforms will be released under an experimental configuration or API. This allows early adopters on certain platforms to try the feature and provide feedback that will feed into the final design of the feature. This, of course, means that there are no guarantees of API stability until it is fully supported by all the platforms it can be supported on, but at least it will unblock development. + +# Final Words + +I'm really proud of what we've been able to achieve with the V2 release. It's amazing to see what people have already been able to build using the beta releases so far. Quality applications like [Varly](https://varly.app/), [Surge](https://getsurge.io/) and [October](https://october.utf9k.net/). I encourage you to check them out. + +This release was achieved through the hard work of many contributors. Whilst it is free to download and use, it has not come about through zero cost. Make no mistakes, this project has come at considerable cost. It has not only been my time and the time of each and every contributor, but also the cost of absence from friends and families of each of those people too. That's why I'm extremely grateful for every second that has been dedicated to making this project happen. The more contributors we have, the more this effort can be spread out and the more we can achieve together. I'd like to encourage you all to pick one thing that you can contribute, whether it is confirming someone's bug, suggesting a fix, making a documentation change or helping out someone who needs it. All of these small things have such a huge impact! It would be so awesome if you too were part of the story in getting to v3. + +Enjoy! + +‐ Lea + +PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/authors.yml b/website/i18n/ko/docusaurus-plugin-content-blog/authors.yml new file mode 100644 index 00000000..a1621fab --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-blog/authors.yml @@ -0,0 +1,10 @@ +leaanthony: + name: Lea Anthony + title: Maintainer of Wails + url: https://github.com/leaanthony + image_url: https://github.com/leaanthony.png +misitebao: + name: Misite Bao + title: Architect + url: https://github.com/misitebao + image_url: https://github.com/misitebao.png diff --git a/website/i18n/ko/docusaurus-plugin-content-blog/options.json b/website/i18n/ko/docusaurus-plugin-content-blog/options.json index 9239ff70..0da3e581 100644 --- a/website/i18n/ko/docusaurus-plugin-content-blog/options.json +++ b/website/i18n/ko/docusaurus-plugin-content-blog/options.json @@ -1,14 +1,14 @@ { "title": { - "message": "Blog", + "message": "블로그", "description": "The title for the blog used in SEO" }, "description": { - "message": "Blog", + "message": "블로그", "description": "The description for the blog used in SEO" }, "sidebar.title": { - "message": "Recent posts", + "message": "최근 글", "description": "The label for the left sidebar" } } diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current.json b/website/i18n/ko/docusaurus-plugin-content-docs/current.json index df52fbac..38c1c83e 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current.json +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current.json @@ -1,22 +1,22 @@ { "version.label": { - "message": "Next", + "message": "다음 버전 🚧", "description": "The label for version current" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "시작하기", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "참조", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { - "message": "Runtime", + "message": "런타임", "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "커뮤니티", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { @@ -24,15 +24,15 @@ "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "가이드", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "튜토리얼", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "기여", "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-docs/current/community/links.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/links.mdx new file mode 100644 index 00000000..3f9ebf2f --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/links.mdx @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +--- + +# Links + +This page serves as a list for community related links. Please submit a PR (click `Edit this page` at the bottom) to submit links. + +## Awesome Wails + +The [definitive list](https://github.com/wailsapp/awesome-wails) of links related to Wails. + +## Support Channels + +- [Gophers Slack Channel](https://gophers.slack.com/messages/CJ4P9F7MZ/) +- [Gophers Slack Channel Invite](https://invite.slack.golangbridge.org/) +- [Github Issues](https://github.com/wailsapp/wails/issues) +- [v2 Beta Discussion Board](https://github.com/wailsapp/wails/discussions/828) + +## Social Media + +- [Twitter](https://twitter.com/wailsapp) +- [Wails Chinese Community QQ Group](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Group number: 1067173054 + +## Other Tutorials and Articles +- [Building of Bulletin Board](https://blog.customct.com/building-bulletin-board) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx new file mode 100644 index 00000000..04150ba2 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx @@ -0,0 +1,10 @@ +# EmailIt + +```mdx-code-block +

+ +
+

+``` + +[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 builtin [Node-Red](https://nodered.org/) server, scripts terminal, and the [ScriptBar](https://github.com/raguay/ScriptBarApp) program for displaying results from Node-Red or a script on your system. Documentation is very scarce, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx new file mode 100644 index 00000000..7504950e --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx @@ -0,0 +1,12 @@ +# EncryptEasy + +```mdx-code-block +

+ +
+

+``` + +**[EncryptEasy](https://www.encrypteasy.app) is a simple and easy to use PGP encryption tool, managing all your and your contacts keys. Encryption should be simple. Developed with Wails.** + +Encrypting messages using PGP is the industry standard. Everyone has a private and a public key. Your private key, well, needs to be kept private so only you can read messages. Your public key is distributed to anyone who wants to send you secret, encrypted messages. Managing keys, encrypting messages and decrypting messages should be a smooth experience. EncryptEasy is all about making it easy. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx new file mode 100644 index 00000000..134365aa --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx @@ -0,0 +1,16 @@ +# FileHound Export Utility + +```mdx-code-block +

+ +
+

+``` + +[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. + +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. + +Backend built with: 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 diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx new file mode 100644 index 00000000..2f6c7c72 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx @@ -0,0 +1,14 @@ +# Minecraft Updater + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx new file mode 100644 index 00000000..f8e2bcd6 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -0,0 +1,14 @@ +# Modal File Manager + +```mdx-code-block +

+ +
+

+``` + +[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. It is fully coded using Go and runs much faster than the previous versions. + +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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx new file mode 100644 index 00000000..5d846d06 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx @@ -0,0 +1,10 @@ +# Molley Wallet + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/october.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/october.mdx new file mode 100644 index 00000000..66d634dc --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/october.mdx @@ -0,0 +1,14 @@ +# October + +```mdx-code-block +

+ +
+

+``` + +[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). + +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/)! + +In contrast, the author's previous attempts with Electron quickly bloated to several hundred megabytes. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx new file mode 100644 index 00000000..6bc28218 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx @@ -0,0 +1,10 @@ +# 옵티머스(Optimus) + +```mdx-code-block +

+ +
+

+``` + +[Optimus](https://github.com/splode/optimus) 데스크탑 이미지 최적화 애플리케이션입니다. WebP, JPEG, PNG 이미지 포맷 형식간의 변환 및 압축을 지원합니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx new file mode 100644 index 00000000..f174364c --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx @@ -0,0 +1,10 @@ +# 포트폴(Portfall) + +```mdx-code-block +

+ +
+

+``` + +[Portfall](https://github.com/rekon-oss/portfall) - 모든 클러스터 UI에 쉽게 액세스할 수 있는 데스크탑 k8s 포트 포워딩 포털입니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx new file mode 100644 index 00000000..3646384e --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx @@ -0,0 +1,12 @@ +# Restic Browser + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx new file mode 100644 index 00000000..9928b478 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx @@ -0,0 +1,21 @@ +# RiftShare + +```mdx-code-block +

+ +
+

+``` + +Easy, Secure, and Free file sharing for everyone. Learn more at [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! diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx new file mode 100644 index 00000000..2ccb2acb --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -0,0 +1,10 @@ +# ScriptBar + +```mdx-code-block +

+ +
+

+``` + +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) is a program to show the output of the embedded [Node-Red](https://nodered.org) server in the [EmailIt](https://GitHub.com/raguay/EmailIt) application. 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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx new file mode 100644 index 00000000..c3b3fb4c --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx @@ -0,0 +1,10 @@ +# Surge + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx new file mode 100644 index 00000000..7408aa58 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx @@ -0,0 +1,10 @@ +# Wally + +```mdx-code-block +

+ +
+

+``` + +[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. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx new file mode 100644 index 00000000..b2dc9302 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx @@ -0,0 +1,10 @@ +# 웜뱃(Wombat) + +```mdx-code-block +

+ +
+

+``` + +[Wombat](https://github.com/rogchap/wombat) 은 크로스 플랫폼인 gRPC 클라이언트 입니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx new file mode 100644 index 00000000..5db428f7 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx @@ -0,0 +1,10 @@ +# Ytd + +```mdx-code-block +

+ +
+

+``` + +[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. 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 new file mode 100644 index 00000000..7f27ab70 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -0,0 +1,56 @@ +--- +sidebar_position: 1 +--- + +# Templates + +This page serves as a list for community supported templates. Please submit a PR (click `Edit this page` at the bottom) to include your templates. To build your own template, please see the [Templates](../guides/templates.mdx) guide. + +To use these templates, run `wails init -n "Your Project Name" -t [the link below[@version]]` + +If there is no version suffix, the main branch code template is used by default. If there is a version suffix, the code template corresponding to the tag of this version is used. + +Example: `wails init -n "Your Project Name" -t https://github.com/misitebao/wails-template-vue` + +:::warning Attention + +**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!** + +If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed. + +::: + +## Vue + +- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - Wails template based on Vue ecology (Integrated TypeScript, Dark theme, Internationalization, Single page routing, TailwindCSS) +- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript with Vite (and instructions to add features) +- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier +- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - A template using JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) +- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - A template using TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API with <script setup>) + +## Angular + +- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n + +## React + +- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - A template using reactjs +- [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 + +## 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-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit + +## Elm + +- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket: +- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Combine the powers :muscle: of Elm + Tailwind CSS + Wails! Hot reloading supported. + +## Pure JavaScript (Vanilla) + +- [wails-pure-js-template](https://github.com/KiddoV/wails-pure-js-template) - A template with nothing but just basic JavaScript, HTML, and CSS diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx new file mode 100644 index 00000000..57d509df --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx @@ -0,0 +1,22 @@ +--- +sidebar_position: 6 +--- + +# 프로젝트 컴파일 + +프로젝트 디렉토리에서 `wails build` 명령을 실행합니다. 이것은 프로젝트를 컴파일하고 `build/bin` 디렉토리에 프로덕션-준비(production-ready) 바이너리를 저장합니다. + +바이너리를 실행하면 기본 애플리케이션이 표시되어야 합니다: + +```mdx-code-block +
+ +
+
+``` + +컴파일 옵션에 대한 자세한 내용은 [CLI Reference](../reference/cli.mdx#build)를 참조하세요. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx new file mode 100644 index 00000000..49dcb09e --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx @@ -0,0 +1,16 @@ +--- +sidebar_position: 5 +--- + +# 애플리케이션 개발하기 + +프로젝트 디렉토리에서 `wails dev` 명령을 실행하여 개발 모드에서 애플리케이션을 실행할 수 있습니다. 이렇게 하면 다음 작업이 수행됩니다. + +- 애플리케이션 빌드 및 실행 +- Javascript에서 호출할 수 있도록 Go 코드를 프론트엔드에 바인딩합니다. +- [Vite](https://vitejs.dev/)의 기능을 사용하여 Go 파일의 수정 사항을 감시하고 변경 시 다시 빌드/재실행 합니다. +- 브라우저를 통해 애플리케이션을 제공할 [Webserver](http://localhost:34115) 를 설정합니다. 이렇게 하면 브라우저 확장을 사용할 수 있습니다. 콘솔에서 Go 코드를 호출할 수도 있습니다. + +시작하려면, 프로젝트 디렉토리 내에서 `wails dev` 명령을 실행하세요. 더많은 정보는 [here](../reference/cli.mdx#dev) 에서 찾을 수 있습니다. + +출시 예정: 튜토리얼 diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx new file mode 100644 index 00000000..a3756d0b --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 2 +--- + +# 프로젝트 생성하기 + +## 프로젝트 생성 + +이제 CLI가 설치되었습니다, `wails init` 명령을 사용하여 새로운 프로젝트를 생성할 수 있습니다. + +원하는 프레임워크를 선택하세요: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + 자바스크립트를 사용하여 Svelte 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t svelte + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t svelte-ts + +
+ + 자바스크립트를 사용하여 React 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t react + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t react-ts + +
+ + 자바스크립트를 사용하여 Vue 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t vue + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t vue-ts + +
+ + 자바스크립트를 사용하여 Preact 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t preact + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t preact-ts + +
+ + 자바스크립트를 사용하여 Lit 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t lit + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t lit-ts + +
+ + 자바스크립트를 사용하여 Vanilla 프로젝트를 생성합니다. with:

+ + wails init -n myproject -t vanilla + +만약 타입스크립트를 사용하기를 원한다면:
+ + wails init -n myproject -t vanilla-ts + +
+
+``` + +
+ +다양한 기능과 프레임워크를 제공하는 [커뮤니티 템플릿](../community/templates.mdx)도 있습니다. + +사용 가능한 다른 옵션을 보려면 `wails init -help` 명령을 실행할 수 있습니다. 자세한 내용은 [CLI Reference](../reference/cli.mdx#init)에서 찾을 수 있습니다. + +## 프로젝트 레이아웃 + +Wails 프로젝트는 다음 레이아웃을 따릅니다: + +``` +. +├── build/ +│ ├── appicon.png +│ ├── darwin/ +│ └── windows/ +├── frontend/ +├── go.mod +├── go.sum +├── main.go +└── wails.json +``` + +### 프로젝트 구조 개요 + +- `/main.go` - 메인 애플리케이션 +- `/frontend/` - Frontend 프로젝트 파일들 +- `/build/` - 프로젝트 빌드 디렉토리 +- `/build/appicon.png` - 애플리케이션 아이콘 +- `/build/darwin/` - Mac 특정 프로젝트 파일 +- `/build/windows/` - Windows 특정 프로젝트 파일 +- `/wails.json` - 프로젝트 구성 파일 +- `/go.mod` - Go 모듈 파일 +- `/go.sum` - Go 모듈 체크섬 파일 + +`frontend` 프론트엔드 디렉토리에는 Wails와 관련된 것이 없으며 선택한 모든 프론트엔드 프로젝트가 될 수 있습니다. + +`build` 디렉토리는 빌드가 진행되는 동안 사용됩니다. 이 파일들을 업데이트 하여 빌드를 커스텀마이징할 수 있습니다. 만약 빌드 디렉토리에서 파일이 제거되면 기본 버전이 재생성됩니다. + +`go.mod`의 기본 모듈 이름은 "changeme" 입니다. 이것을 더 적절한 것으로 변경해야 합니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx new file mode 100644 index 00000000..7909a16e --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx @@ -0,0 +1,89 @@ +--- +sidebar_position: 1 +--- + +# 설치하기 + +## 지원되는 플랫폼 + +- Windows 10/11 AMD64/ARM64 +- MacOS 10.13+ AMD64 +- MacOS 11.0+ ARM64 +- Linux AMD64/ARM64 + +## 의존성 + +Wails는 설치 전에 아래와 같은 몇 가지 공통적인 의존성이 필요합니다. + +- Go 1.18+ +- NPM (Node 15+) + +### Go + +[Go 다운로드 페이지](https://go.dev/dl/)에서 Go를 다운로드 합니다. + +공식 [Go 설치 지침](https://go.dev/doc/install)에 따라 진행하세요. 또한 `PATH` 환경 변수에 `~/go/bin` 디렉토리에 대한 경로도 포함되어 있는지 확인해야 합니다. 터미널을 다시 시작하고 아래 내용을 확인하세요. + +- Go가 정상적으로 설치되었는지 확인: `go version` +- PATH 변수에 "~/go/bin" 확인: `echo $PATH | grep go/bin` + +### NPM + +[Node 다운로드 페이지](https://nodejs.org/en/download/)에서 NPM을 다운로드 합니다. 우리는 일반적으로 최신 버전에서 테스트를 진행하기 때문에 최신 버전 사용을 권장합니다. + +정상적으로 설치된 것을 확인하기 위해 `npm --version`을 실행합니다. + +## 플랫폼에 따른 의존성 + +플랫폼별 의존 항목도 설치해야 합니다: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Wails 는 xcode line tools 설치를 필요로 합니다. xcode-select --install. 를 실행하여 수행할 수 있습니다. + + + Wails 는 WebView2 런타임 설치를 필요로 합니다. 몇몇 Windows는 이미 설치되어 있습니다. wails doctor 명령을 사용하여 확인할 수 있습니다. + + + 리눅스는 표준 gcc 빌드 툴과 libgtk3libwebkit를 필요로 합니다. 다양한 배포판에 대한 수 많은 명령을 나열하는 대신 Wail는 특정 배포판에 대한 설치 명령이 무엇인지 결정할 수 있습니다. wails doctor 명령을 실행하면 설치 후 종속성을 설치하는 방법을 보여줍니다. 만약 배포판/패키지 매니저가 지원하지 않는다면, 를 통해 문의하세요. 리눅스 배포판 추가 가이드 + + +``` + +## 선택 설치 + +- [UPX](https://upx.github.io/) 는 애플리케이션 압축을 위함. +- [NSIS](https://wails.io/docs/guides/windows-installer/) 는 윈도우 인스톨러를 생성하기 위함. + +## Wails 설치 + +`go install github.com/wailsapp/wails/v2/cmd/wails@latest`을 실행하여 Wails CLI를 설치합니다. + +참고: 다음과 비슷한 오류가 발생하는 경우: + +```shell +....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found +``` +Go 1.18 이상의 버전이 설치되어 있는지 확인하세요: +```shell +go version +``` + +## 시스템 점검 + +`wails doctor`를 실행하면 의존성이 올바르게 설치되어 있는지 점검할 수 있습니다. 문제가 있는 의존성에 대해서는 문제 해결을 위한 도움을 줄 수 있습니다. + +## `wails` 명령어를 찾을 수 없나요? + +시스템에서 `wails` 명령어를 찾을 수 없는 경우 Go 설치 지침을 잘 따라했는지 확인해보세요. 일반적으로, 사용자의 홈 디렉토리에 있는 `go/bin` 디렉토리가 `PATH` 환경 변수에 없음을 의미합니다. 또한, 설치 프로그램이 수행한 환경 변경 사항이 명령 프롬프트에 반영되도록 일반적으로 열려 있는 모든 명령 프롬프트를 닫았다가 다시 열어야합니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/angular.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/angular.mdx new file mode 100644 index 00000000..1b21f9da --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/angular.mdx @@ -0,0 +1,14 @@ +# Angular + +Wails에는 Angular 템플릿이 없지만 Wails와 함께 Angular를 사용할 수 있습니다. + +## 개발자 모드 + +Angular에서 작동하는 개발 모드를 사용하려면 `wails.json`에 다음을 추가해야 합니다. + +```json + "frontend:build": "npx ng build", + "frontend:install": "npm install", + "frontend:dev:watcher": "npx ng serve", + "frontend:dev:serverUrl": "http://localhost:4200", +``` \ No newline at end of file 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 new file mode 100644 index 00000000..3a85cbd3 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -0,0 +1,194 @@ +# 애플리케이션 개발 + +Wails로 애플리케이션을 개발하기 위한 엄격한 규칙은 없으나 몇 가지의 기본 가이드가 있습니다. + +## 애플리케이션 셋업 + +기본 템플릿에서 사용되는 패턴은 `main.go`가 애플리케이션 구성 및 실행에 사용되는 반면 `app.go`는 애플리케이션 로직 정의에 사용된다는 것입니다. + +`app.go` 파일은 기본 애플리케이션에 hook 역할을 하는 2개의 메소드가 있는 구조체를 정의합니다. + +```go title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} +``` + +- 시작 메서드는 Wails가 필요한 리소스를 할당하는 즉시 호출되며 리소스 생성, 이벤트 리스너 설정 및 시작 시 응용 프로그램에 필요한 모든 것을 설정하기에 좋은 위치입니다. 일반적으로 구조체 필드에 저장되는 `context.Context`가 제공됩니다. 이 컨텍스트는 [런타임](../reference/runtime/intro.mdx)을 호출하는 데 필요합니다. 이 메서드가 오류를 반환하면 응용 프로그램이 종료됩니다. 개발 모드에서는 오류가 콘솔에 출력됩니다. + +- Shutdown 메소드는 shutdown 프로세스가 끝날 때 바로 Wails에 의해 호출됩니다. 이것은 메모리 할당을 해제하고 모든 shutodown 작업을 수행하기에 좋은 위치입니다. + +`main.go` 파일은 일반적으로 애플리케이션 구성을 허용하는 `wails.Run()`에 대한 단일 호출로 구성됩니다. 템플릿에서 사용하는 패턴은 `wails.Run()`을 호출하기 전에 `app.go`에서 정의한 구조체의 인스턴스가 생성되어 변수에 저장된다는 것입니다. 이것은 `app`이라고 합니다. 이 configuration 은 콜백을 추가하는 위치입니다: + +```go {3,9,10} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +애플리케이션 lifecycle hook에 대한 자세한 내용은 [여기](../howdoesitwork.mdx#application-lifecycle-callbacks)에서 확인할 수 있습니다. + +## 바인딩 메소드 + +프론트엔드에서 Go 메서드를 호출할 가능성이 높습니다. 이는 일반적으로 `app.go`에서 이미 정의된 구조체에 public method를 추가하여 수행됩니다. + +```go {16-18} title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +In the main application configuration, the `Bind` key is where we can tell Wails what we want to bind: + +```go {11-13} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods). + +### Dealing with context when binding multiple structs + +If you want to bind methods for multiple structs but want each struct to keep a reference to the context so that you can use the runtime functions, a good pattern is to pass the context from the `OnStartup` method to your struct instances : + +```go +func main() { + + app := NewApp() + otherStruct := NewOtherStruct() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: func(ctx context.Context){ + app.SetContext(ctx) + otherStruct.SetContext(ctx) + }, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + otherStruct + }, + }) + if err != nil { + log.Fatal(err) + } +} +``` + +More information on Binding can be found [here](../howdoesitwork.mdx#method-binding). + +## Application Menu + +Wails supports adding a menu to your application. This is done by passing a [Menu](../reference/menus.mdx#menu) struct to application config. It's common to use a method that returns a Menu, and even more common for that to be a method on the `App` struct used for the lifecycle hooks. + +```go {11} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Menu: app.menu(), + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +## Assets + +The great thing about the way Wails v2 handles assets is that it doesn't! The only thing you need to give Wails is an `embed.FS`. How you get to that is entirely up to you. You can use vanilla html/css/js files like the vanilla template. You could have some complicated build system, it doesn't matter. + +When `wails build` is run, it will check the `wails.json` project file at the project root. There are 2 keys in the project file that are read: + +- "frontend:install" +- "frontend:build" + +The first, if given, will be executed in the `frontend` directory to install the node modules. The second, if given, will be executed in the `frontend` directory to build the frontend project. + +If these 2 keys aren't given, then Wails does absolutely nothing with the frontend. It is only expecting that `embed.FS`. + +### AssetsHandler + +A Wails v2 app can optionally define a `http.Handler` in the `options.App`, which allows hooking into the AssetServer to create files on the fly or process POST/PUT requests. GET requests are always first handled by the `assets` FS. If the FS doesn't find the requested file the request will be forwarded to the `http.Handler` for serving. Any requests other than GET will be directly processed by the `AssetsHandler` if specified. It's also possible to only use the `AssetsHandler` by specifiy `nil` as the `Assets` option. + +## Built in Dev Server + +Running `wails dev` will start the built in dev server which will start a file watcher in your project directory. By default, if any file changes, wails checks if it was an application file (default: `.go`, configurable with `-e` flag). If it was, then it will rebuild your application and relaunch it. If the changed file was in the assets, it will issue a reload after a short amount of time. + +The dev server uses a technique called "debouncing" which means it doesn't reload straight away, as there may be multiple files changed in a short amount of time. When a trigger occurs, it waits for a set amount of time before issuing a reload. If another trigger happens, it resets to the wait time again. By default this value is `100ms`. If this value doesn't work for your project, it can be configured using the `-debounce` flag. If used, this value will be saved to your project config and become the default. + +## 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. + +## Go Module + +The default Wails templates generate a `go.mod` file that contains the module name "changeme". You should change this to something more appropriate after project generation. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx new file mode 100644 index 00000000..73173e15 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx @@ -0,0 +1,136 @@ +# Dynamic Assets + +If you want to load or generate assets for your frontend dynamically, you can achieve that using the [AssetsHandler](../reference/options#assetshandler) option. The AssetsHandler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the bundled assets because the file is not found. + +By installing a custom AssetsHandler, you can serve your own assets using a custom asset server. + +## Example + +In our example project, we will create a simple assets handler which will load files off disk: + +```go title=main.go {16-35,49} +package main + +import ( + "embed" + "fmt" + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "net/http" + "os" + "strings" +) + +//go:embed all:frontend/dist +var assets embed.FS + +type FileLoader struct { + http.Handler +} + +func NewFileLoader() *FileLoader { + return &FileLoader{} +} + +func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request) { + var err error + requestedFilename := strings.TrimPrefix(req.URL.Path, "/") + println("Requesting file:", requestedFilename) + fileData, err := os.ReadFile(requestedFilename) + if err != nil { + res.WriteHeader(http.StatusBadRequest) + res.Write([]byte(fmt.Sprintf("Could not load file %s", requestedFilename))) + } + + res.Write(fileData) +} + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "helloworld", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: NewFileLoader(), + }, + BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 255}, + OnStartup: app.startup, + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +When we run the application in dev mode using `wails dev`, we will see the following output: + +``` +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' failed, using AssetHandler +Requesting file: favicon.ico +``` + +As you can see, the assets handler is called when the default assets server is unable to serve the `favicon.ico` file. + +If you right click the main application and select "inspect" to bring up the devtools, you can test this feature out by typing the following into the console: + +``` +let response = await fetch('does-not-exist.txt'); +``` + +This will generate an error in the devtools. We can see that the error is what we expect, returned by our custom assets handler: + +```mdx-code-block +

+ +

+``` + +However, if we request `go.mod`, we will see the following output: + +```mdx-code-block +

+ +

+``` + +This technique can be used to load images directly into the page. If we updated our default vanilla template and replaced the logo image: + +```html + +``` + +with: + +```html + +``` + +Then we would see the following: + +```mdx-code-block +

+ +

+``` + +:::warning + +Exposing your filesystem in this way is a security risk. It is recommended that you properly manage access to your filesystem. + +::: diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frameless.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frameless.mdx new file mode 100644 index 00000000..3845736f --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frameless.mdx @@ -0,0 +1,87 @@ +# Frameless Applications + +Wails supports application that have no frames. This can be achieved by using the [frameless](../reference/options.mdx#frameless) field in [Application Options](../reference/options.mdx#application-options). + +Wails offers a simple solution for dragging the window: Any HTML element that has the CSS style `--wails-draggable:drag` will act as a "drag handle". This property applies to all child elements. If you need to indicate that a nested element should not drag, then use the attribute '--wails-draggable:no-drag' on that element. + +```html + + + + + + + +
+ + +
+
+ + + + +``` + +For some projects, using a CSS variable may not be possible due to dynamic styling. In this case, you can use the `CSSDragProperty` and `CSSDragValue` application options to define a property and value that will be used to indicate draggable regions: + +```go title=main.go +package main + +import ( + "embed" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "alwaysontop", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Frameless: true, + CSSDragProperty: "widows", + CSSDragValue: "1", + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +```html title=index.html + + + + + + alwaysontop + + +
+ + + +``` + +:::info Fullscreen + +If you allow your application to go fullscreen, this drag functionality will be disabled. + +::: diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frontend.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frontend.mdx new file mode 100644 index 00000000..ac087ee4 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/frontend.mdx @@ -0,0 +1,72 @@ +# Frontend + +## Script Injection + +When Wails serves your `index.html`, by default, it will inject 2 script entries into the `` tag to load `/wails/ipc.js` and `/wails/runtime.js`. These files install the bindings and runtime respectively. + +The code below shows where these are injected by default: + +```html + + + injection example + + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + +``` + +### Overriding Default Script Injection + +To provide more flexibility to developers, there is a meta tag that may be used to customise this behaviour: + +```html + +``` + +The options are as follows: + +| Value | Description | +| ------------------- | ------------------------------------------------ | +| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` | +| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` | +| noautoinject | Disable all autoinjection of scripts | + +Multiple options may be used provided they are comma seperated. + +This code is perfectly valid and operates the same as the autoinjection version: + +```html + + + injection example + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + + + +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/ides.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/ides.mdx new file mode 100644 index 00000000..f7428228 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/ides.mdx @@ -0,0 +1,127 @@ +# IDEs + +Wails aims to provide a great development experience. To that aim, we now support generating IDE specific configuration to provide smoother project setup. + +Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but aim to support other IDEs such as Goland. + +## Visual Studio Code + +```mdx-code-block +

+ +

+``` + +When generating a project using the `-ide vscode` flags, IDE files will be created alongside the other project files. These files are placed into the `.vscode` directory and provide the correct configuration for debugging your application. + +The 2 files generated are `tasks.json` and `launch.json`. Below are the files generated for the default vanilla project: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/myproject.exe" + ] + } + ] +} +``` + +```json title="launch.json" +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Wails: Debug myproject", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/build/bin/myproject.exe", + "preLaunchTask": "build", + "cwd": "${workspaceFolder}", + "env": {} + } + ] +} +``` + +### Configuring the install and build steps + +The `tasks.json` file is simple for the default project as there is no `npm install` or `npm run build` step needed. For projects that have a frontend build step, such as the svelte template, we would need to edit `tasks.json` to add the install and build steps: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "npm install", + "type": "npm", + "script": "install", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "npm run build", + "type": "npm", + "script": "build", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/vscode.exe" + ], + "dependsOn": ["npm install", "npm run build"] + } + ] +} +``` + +:::info Future Enhancement + +In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically. + +::: diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx new file mode 100644 index 00000000..8b25c157 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx @@ -0,0 +1,103 @@ +# Linux Distro Support + +## Overview + +Wails offers Linux support but providing installation instructions for all available distributions is an impossible task. Instead, Wails tries to determine if the packages you need to develop applications are available via your system's package manager. Currently, we support the following package managers: + +- apt +- dnf +- emerge +- eopkg +- nixpkgs +- pacman +- zypper + +## Adding package names + +There may be circumstances where your distro uses one of the supported package managers but the package name is different. For example, you may use an Ubuntu derivative, but the package name for gtk may be different. Wails attempts to find the correct package by iterating through a list of package names. The list of packages are stored in the packagemanager specific file in the `v2/internal/system/packagemanager` directory. In our example, this would be `v2/internal/system/packagemanager/apt.go`. + +In this file, the list of packages are defined by the `Packages()` method: + +```go +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +Let's assume that in our linux distro, `libgtk-3` is packaged under the name `lib-gtk3-dev`. We could add support for this by adding the following line: + +```go {5} +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + {Name: "lib-gtk3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +## Adding new package managers + +To add a new package manager, perform the following steps: + +- Create a new file in `v2/internal/system/packagemanager` called `.go`, where `` is the name of the package manager. +- Define a struct that conforms to the package manager interface defined in `pm.go`: + +```go +type PackageManager interface { + Name() string + Packages() packagemap + PackageInstalled(*Package) (bool, error) + PackageAvailable(*Package) (bool, error) + InstallCommand(*Package) string +} +``` + +- `Name()` should return the name of the package manager +- `Packages()` should return a `packagemap`, that provides candidate filenames for dependencies +- `PackageInstalled()` should return `true` if the given package is installed +- `PackageAvailable()` should return `true` if the given package is not installed but available for installation +- `InstallCommand()` should return the exact command to install the given package name + +Take a look at the other package managers code to get an idea how this works. + +:::info Remember + +If you add support for a new package manager, don't forget to also update this page! + +::: diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux.mdx new file mode 100644 index 00000000..229c282b --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/linux.mdx @@ -0,0 +1,18 @@ +# Linux + +This page has miscellaneous guides related to developing Wails applications for Linux. + +## Video tag doesn't fire "ended" event + +When using a video tag, the "ended" event is not fired when the video is finished playing. This is a bug in WebkitGTK, however you can use the following workaround to fix it: + +```js +videoTag.addEventListener("timeupdate", (event) => { + if (event.target.duration - event.target.currentTime < 0.2) { + let ended = new Event("ended"); + event.target.dispatchEvent(ended); + } +}); +``` + +Source: [Lyimmi](https://github.com/Lyimmi) on the [discussions board](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/local-development.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/local-development.mdx new file mode 100644 index 00000000..4ba1f34c --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/local-development.mdx @@ -0,0 +1,55 @@ +# Local Development + +## Overview + +Wails is in constant development and new releases are regularly "tagged". This usually happens when all the newer code on `master` has been tested and confirmed working. If you need a bugfix or feature that has not yet made it to a release, it's possible to use the latest "bleeding edge" version using the following steps: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails/v2/cmd/wails` +- `go install` + +NOTE: The directory that you cloned the project into will now be called "clonedir". + +The Wails CLI will now be at the very latest version. + +### Updating your project + +To update projects to use the latest version of the Wails library, update the project's `go.mod` and ensure the following line is at the bottom of the file: + +`replace github.com/wailsapp/wails/v2 => ` + +Example: + +On Windows: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2` + +On 'nix: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2` + +To revert to a stable version, run: + +`go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +## Testing a Branch + +If you want to test a branch, follow the instructions above, but ensure you switch the branch you want to test before installing: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git checkout -b branch-to-test --track origin/branch-to-test` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. + +## Testing a PR + +If you want to test a PR, follow the instructions above, but ensure you fetch the PR and switch the branch before installing. Please replace `[IDofThePR]` with the ID of the PR shown on github.com: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git fetch -u origin pull/[IDofThePR]/head:test/pr-[IDofThePR]` +- `git checkout test/pr-[IDofThePR]` +- `git reset --hard HEAD` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx new file mode 100644 index 00000000..dcf192d3 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx @@ -0,0 +1,95 @@ +# Manual Builds + +The Wails CLI does a lot of heavy lifting for the project, but sometimes it's desirable to manually build your project. This document will discuss the different operations the CLI does and how this may be achieved in different ways. + +## Build Process + +When either `wails build` or `wails dev` are used, the Wails CLI performs a common build process: + + - Install frontend dependencies + - Build frontend project + - Generate build assets + - Compile application + - [optional] Compress application + +### Install frontend dependencies + +#### CLI Steps + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is an install command in the key `frontend:install` +- If there isn't, it skips this step +- If there is, it checks if `package.json` exists in the frontend directory. If it doesn't exist, it skips this step +- An MD5 sum is generated from the `package.json` file contents +- It checks for the existence of `package.json.md5` and if it exists, will compare the contents of it (an MD5 sum) with the one generated to see if the contents have changed. If they are the same, this step is skipped +- If `package.json.md5` does not exist, it creates it using the generated MD5 sum +- If a build is now required, or `node_modules` does not exist, or the `-f` flag is given, the install command is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm install`. + +### Build frontend project + +#### Wails CLI + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is a build command in the key `frontend:build` +- If there isn't, it skips this step +- If there is, it is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm run build` or whatever the frontend build script is. + +### Generate assets + +#### Wails CLI + +- If `-nopackage` flag is set, this stage is skipped +- If the `build/appicon.png` file does not exist, a default one is created +- For Windows, see [Bundling for Windows](#windows) +- If `build/windows/icon.ico` does not exist, it will create it from the `build/appicon.png` image. + +##### Windows + +- If `build/windows/icon.ico` does not exist, it will create it from `build/appicon.png` using icon sizes of 256, 128, 64, 48, 32 and 16. This is done using [winicon](https://github.com/leaanthony/winicon). +- If the `build/windows/.manifest` file does not exist, it creates it from a default version. +- Compiles the application as a production build (above) +- Uses [winres](https://github.com/tc-hib/winres) to bundle the icon and manifest into a `.syso` file ready for linking. + +#### Manual Steps + +- Create `icon.ico` using the [winicon](https://github.com/leaanthony/winicon) CLI tool (or any other tool). +- Create / Update a `.manifest` file for your application +- Use the [winres CLI](https://github.com/tc-hib/go-winres) to generate a `.syso` file. + +### Compile application + +#### Wails CLI + +- If the `-clean` flag is provided, the `build` directory is deleted and recreated +- For `wails dev`, the following default Go flags are used: `-tags dev -gcflags "all=-N -l"` +- For `wails build`, the following default Go flags are used: `-tags desktop,production -ldflags "-w -s"` + - On Windows, `-ldflags "-w -h -H windowsgui"` +- Additional tags passed to the CLI using `-tags` are added to the defaults +- Additional ldflags passed to the CLI using `-ldflags` are added to the defaults +- The `-o` flag is passed through +- The Go compiler specified by `-compiler` will be used for compilation + +#### Manual steps + +- For dev build, the minimum command would be: `go build -tags dev -gcflags "all=-N -l"` +- For production build, the minimum command would be: `go build -tags desktop,production -ldflags "-w -s -H windowsgui"` +- Ensure that you compile in the same directory as the `.syso` file + +### Compress application + +#### Wails CLI + +- If the `-upx` flag has been given, the `upx` program will be run to compress the application with the default settings +- If `-upxflags` is also passed, these flags are used instead of the default ones + +#### Manual steps + +- Run `upx [flags]` manually to compress the application. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/migrating.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/migrating.mdx new file mode 100644 index 00000000..9915e230 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/migrating.mdx @@ -0,0 +1,191 @@ +# Migrating from v1 + +## Overview + +Wails v2 is a significant change from v1. This document aims to highlight the changes and the steps in migrating an existing project. + +### Creating the Application + +In v1, the main application is created using `wails.CreateApp`, bindings are added with `app.Bind`, then the application is run using `app.Run()`. + +Example: + +```go title="v1" + app := wails.CreateApp(&wails.AppConfig{ + Title: "MyApp", + Width: 1024, + Height: 768, + JS: js, + CSS: css, + Colour: "#131313", + }) + app.Bind(basic) + app.Run() +``` + +In v2, there is just a single method, `wails.Run()`, that accepts [application options](../reference/options.mdx#application-options). + +```go title="v2" + err := wails.Run(&options.App{ + Title: "MyApp", + Width: 800, + Height: 600, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + basic, + }, + }) +``` + +### Binding + +In v1, it was possible to bind both arbitrary functions and structs. In v2, this has been simplified to only binding structs. The struct instances that were previously passed to the `Bind()` method in v1, are now specified in the `Bind` field of the [application options](../reference/options.mdx#application-options): + +```go title="v1" + app := wails.CreateApp(/* options */) + app.Bind(basic) +``` + +```go title="v2" + err := wails.Run(&options.App{ + /* other options */ + Bind: []interface{}{ + basic, + }, + }) +``` + +In v1, bound methods were available to the frontend at `window.backend`. This has changed to `window.go`.`` + +### Application Lifecycle + +In v1, there were 2 special methods in a bound struct: `WailsInit()` and `WailsShutdown()`. These have been replaced with 3 lifecycle hooks as part of the [application options](../reference/options.mdx#application-options): + +- [OnStartup](../reference/options.mdx#onstartup) +- [OnShutdown](../reference/options.mdx#onshutdown) +- [OnDomReady](../reference/options.mdx#ondomready) + +Note: [OnDomReady](../reference/options.mdx#ondomready) replaces the `wails:ready` system event in v1. + +These methods can be standard functions, but a common practice is to have them part of a struct: + +```go title="v2" + basic := NewBasicApp() + err := wails.Run(&options.App{ + /* Other Options */ + OnStartup: basic.startup, + OnShutdown: basic.shutdown, + OnDomReady: basic.domready, + }) +... +type Basic struct { + ctx context.Context +} +func (b *Basic) startup(ctx context.Context) { + b.ctx = ctx +} +... +``` + +### Runtime + +The runtime in v2 is much richer than v1 with support for menus, window manipulation and better dialogs. The signature of the methods has changed slightly - please refer the the [Runtime Reference](../reference/runtime/intro.mdx). + +In v1, the [runtime](../reference/runtime/intro.mdx) was available via a struct passed to `WailsInit()`. In v2, the runtime has been moved out to its own package. Each method in the runtime takes the `context.Context` that is passed to the [OnStartup](../reference/options.mdx#onstartup) method. + +```go title="Runtime Example" +package main + +import "github.com/wailsapp/wails/v2/pkg/runtime" + +type Basic struct { + ctx context.Context +} + +// startup is called at application startup +func (a *App) startup(ctx context.Context) { + a.ctx = ctx + runtime.LogInfo(ctx, "Application Startup called!") +} + +``` + +### Assets + +The _biggest_ change in v2 is how assets are handled. + +In v1, assets were passed via 2 application options: + +- `JS` - The application's Javascript +- `CSS` - The application's CSS + +This meant that the responsibility of generating a single JS and CSS file was on the developer. This essentially required the use of complicated packers such as webpack. + +In v2, Wails makes no assumptions about your frontend assets, just like a webserver. All of your application assets are passed to the application options as an `embed.FS`. + +**This means there is no requirement to bundle your assets, encode images as Base64 or attempt the dark art of bundler configuration to use custom fonts**. + +At startup, Wails will scan the given `embed.FS` for `index.html` and use its location as the root path for all the other application assets - just like a webserver would. + +Example: An application has the following project layout. All final assets are placed in the `frontend/dist` directory: + +```shell +. +├── build/ +├── frontend/ +│ └── dist/ +│ ├── index.html +│ ├── main.js +│ ├── main.css +│ └── logo.svg +├── main.go +└── wails.json +``` + +Those assets may be used by the application by simply creating an `embed.FS`: + +```go title="Assets Example" +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + err := wails.Run(&options.App{ + /* Other Options */ + AssetServer: &assetserver.Options{ + Assets: assets, + }, + }) +} +``` + +Of course, bundlers can be used if you wish to. The only requirement is to pass the final application assets directory to Wails using an `embed.FS` in the `Assets` key of the [application options](../reference/options.mdx#application-options). + +### Project Configuration + +In v1, the project configuration was stored in the `project.json` file in the project root. In v2, the project configuration is stored in the `wails.json` file in the project root. + +The format of the file is slightly different. Here is a comparison: + +

+ +| v1 | v2 | Notes | +| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | name | | +| description | | Removed | +| author / name | author / name | | +| author / email | author / email | | +| version | version | | +| binaryname | outputfilename | Changed | +| frontend / dir | | Removed | +| frontend / install | frontend:install | Changed | +| frontend / build | frontend:build | Changed | +| frontend / bridge | | Removed | +| frontend / serve | | Removed | +| tags | | Removed | +| | wailsjsdir | The directory to generate wailsjs modules | +| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. | +| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. This is only needed for some more advanced asset configurations. | + +

diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx new file mode 100644 index 00000000..4a3de2a6 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx @@ -0,0 +1,25 @@ +# Mouse Buttons + +The Wails runtime intercepts mouse clicks to determine whether a frameless window needs resizing or a window needs to be moved. It has been asked how to detect when a mouse click has occurred, because `window.onclick` doesn't report the mouse buttons correctly. The following code shows how to detect mouse clicks: + +```javascript +window.addEventListener("mousedown", handleMouseButtonDown); + +function handleMouseButtonDown(event) { + if (event.button === 0) { + // left mouse button + } else if (event.button === 1) { + // middle mouse button + } else if (event.button === 2) { + // right mouse button + } else if (event.button === 3) { + // back mouse button + } else if (event.button === 4) { + // forward mouse button + } else { + // other mouse button + } +} +``` + +Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx new file mode 100644 index 00000000..21f7875e --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx @@ -0,0 +1,40 @@ +# Obfuscated Builds + +Wails includes support for obfuscating your application using [garble](https://github.com/burrowers/garble). + +To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command: + +```bash +wails build -obfuscated +``` + +To customise the obfuscation settings, you can use the `-garbleargs` flag: + +```bash +wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed" +``` + +These settings may be persisted in your [project config](../reference/project-config). + +## How it works + +In a standard build, all bound methods are available in the frontend under the `window.go` variable. When these methods are called, the corresponding backend method is called using the fully qualified function name. When using an obfuscated build, methods are bound using an ID instead of a name. The bindings generated in the `wailsjs` directory use these IDs to call the backend functions. + +:::note + +To ensure that your application will work in obfuscated mode, you must use the generated bindings under the `wailsjs` directory in your application. + +::: + +## Example + +Importing the "Greet" method from the bindings like this: + +```js +import { Greet } from "../../wailsjs/go/main/App"; + +// snip +Greet("World"); +``` + +will ensure that the method will work correctly in obfuscated mode, as the bindings will be regenerated with IDs and the call mechanism updated. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/overscroll.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/overscroll.mdx new file mode 100644 index 00000000..e94cfbb7 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/overscroll.mdx @@ -0,0 +1,10 @@ +# 오버스크롤(Overscroll) + +[Overscroll](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) 은 페이지의 콘텐츠 경계를 넘어 스크롤할 때 가끔 발생하는 "바운스 효과"입니다. 이것은 모바일 앱에서도 동일합니다. CSS를 사용하여 비활성 할 수 있습니다. + +```css +html { + height: 100%; + overflow: hidden; +} +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx new file mode 100644 index 00000000..c35cc1c8 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/routing.mdx @@ -0,0 +1,47 @@ +# Routing + +Routing is a popular way to switch views in an application. This page offers some guidance around how to do that. + +## Vue + +The recommended approach for routing in Vue is [Hash Mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode): + +```js +import { createRouter, createWebHashHistory } from "vue-router"; + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + //... + ], +}); +``` + +## Angular + +The recommended approach for routing in Angular is [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy): + +```ts +RouterModule.forRoot(routes, { useHash: true }); +``` + +## React + +The recommended approach for routing in React is [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router): + +```jsx +import { HashRouter } from "react-router-dom"; + +ReactDOM.render( + + {/* The rest of your app goes here */} + + } exact /> + } /> + } /> + {/* more... */} + + , + root +); +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/signing.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/signing.mdx new file mode 100644 index 00000000..4c7cf45b --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/signing.mdx @@ -0,0 +1,387 @@ +# Code Signing + +This is a guide on how you can sign your binaries generated with Wails on MacOS and Windows. The guide will target CI environments, more specifically GitHub Actions. + +## Windows + +First off you need a code signing certificate. If you do not already have one, Microsoft's info page lists some providers [here](https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate). Please note that an EV certificate is not required unless you need to write kernel-level software such as device drivers. For signing your Wails app, a standard code signing certificate will do just fine. + +It may be a good idea to check with your certificate provider how to sign your binaries on your local machine before targeting automated build systems, just so you know if there are any special requirements. For instance, [here](https://www.ssl.com/how-to/using-your-code-signing-certificate/) is SSL.com's code signing guide for Windows. If you know how to sign locally, it will be easier to troubleshoot any potential issues in a CI environment. For instance, SSL.com code signing certificates require the `/tr` flag for [SignTool.exe](https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool) while other providers may only need the `/t` flag for providing the timestamping server. Popular GitHub Actions for signing Windows binaries like [this one](https://github.com/Dana-Prajea/code-sign-action) does not support the `/tr` flag on SignTool.exe. Therefore this guide will focus on signing our app manually with PowerShell commands, but you can use actions like the [code-sign-action](https://github.com/Dana-Prajea/code-sign-action) Action if you prefer. + +First off, let's make sure we are able to build our Wails app in our GitHub CI. Here is a small workflow template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend manually here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +Next we need to give the GitHub workflow access to our signing certificate. This is done by encoding your .pfx or .p12 certificate into a base64 string. To do this in PowerShell, you can use the following command assuming your certificate is called 'my-cert.p12': + +```PowerShell +certutil -encode .\my-cert.p12 my-cert-base64.txt +``` + +You should now have your .txt file with the base64 encoded certificate. It should start with _-----BEGIN CERTIFICATE-----_ and end with _-----END CERTIFICATE-----_. Now you need to make two action secrets on GitHub. Navigate to _Settings -> Secrets -> Actions_ and create the two following secrets: + +- **WIN_SIGNING_CERT** with the contents of your base64 encoded certificate text. +- **WIN_SIGNING_CERT_PASSWORD** with the contents of your certificate password. + +Now we're ready to implement the signing in our workflow using one of the two methods: + +### Method 1: signing with commands + +This method uses PowerShell commands to sign our app, and leaves you control over the entire signing process. + +After the `"Build Wails app"` step, we can add the following step to our workflow: + +```yaml +- name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd /t /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' + +``` + +This script creates a new directory for your certificate file, creates the certificate file from our base64 secret, converts it to a .pfx file, and finally signs the binary. The following variables needs to be replaced in the last line: + +- **signing algorithm**: usually sha256. +- **timestamping server**: URL to the timestamping server to use with your certificate. +- **path to binary**: path to the binary you want to sign. + +Given that our Wails config has `outputfilename` set to "app.exe" and that we have a certificate from SSL.com, this would be our workflow: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\app.exe + + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +### Method 2: automatically signing with Action + +It is possible to use a Windows code signing Action like [this](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate) one, but note it requires a SHA1 hash for the certificate and a certificate name. View an example of how to configure it on the Action's [marketplace](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate). + +--- + +## MacOS + +First off you need your code signing certificate from Apple. If you do not have one, a simple Google search will help you acquire one. Once you have your certificate, you need to export it and encode it to base64. [This tutorial](https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions) shows you how to do that in an easy manner. Once you have exported your .p12 certificate file, you can encode it to base64 as seen in the tutorial with the following command: + +```bash +base64 Certificates.p12 | pbcopy +``` + +Now you're ready to create some GitHub project secrets, just as with Windows: + +- **APPLE_DEVELOPER_CERTIFICATE_P12_BASE64** with the contents of your newly copied base64 certificate. +- **APPLE_DEVELOPER_CERTIFICATE_PASSWORD** with the contents of your certificate password. +- **APPLE_PASSWORD** with the contents of an App-Specific password to your Apple-ID account which you can generate [here](https://appleid.apple.com/account/manage). + +Let's make sure we are able to build our Wails app in our GitHub Action workflow. Here is a small template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +For code signing on macOS, [gon](https://github.com/mitchellh/gon) is a very handy tool for code signing and communicating with Apple servers, also written in Go, and will be used in this guide. + +After the `Build Wails app` step, add the following to the workflow: + +```yaml +- name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon +``` + +Now we need to configure some gon config files in our `build/darwin` directory: + +1. gon-sign.json: + +```json +{ + "source": ["./build/bin/app.app"], + "bundle_id": "app.myapp", + "apple_id": { + "username": "my-appleid@email.com", + "password": "@env:APPLE_PASSWORD" + }, + "sign": { + "application_identity": "Developer ID Application: My Name" + } +} +``` + +Where `source` is your Wails binary, `bundle_id` is your bundle ID, `apple_id` contains your Apple ID username and App-Specific password which you created earlier, and `sign.application_identity` is your identity which you can find by running the following command: + +```bash +security find-identity -v -p codesigning +``` + +2. entitlements.plist: + +```plist + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.downloads.read-write + + + +``` + +In this file you configure the entitlements you need for you app, e.g. camera permissions if your app uses the camera. Read more about entitlements [here](https://developer.apple.com/documentation/bundleresources/entitlements). + +Make sure you have updated your `Info.plist` file with the same bundle ID as you entered in `gon-sign.json`. Here's an example `Info.plist` file: + +```plist + + + CFBundlePackageTypeAPPL + CFBundleNameMyApp + CFBundleExecutableapp + CFBundleIdentifierapp.myapp + CFBundleVersion0.1.0 + CFBundleGetInfoStringMy app is cool and nice and chill and + CFBundleShortVersionString0.1.0 + CFBundleIconFileiconfile + LSMinimumSystemVersion10.13.0 + NSHighResolutionCapabletrue + LSApplicationCategoryTypepublic.app-category.utilities + NSHumanReadableCopyright© Me + +``` + +Now we're ready to add the signing step in our workflow after building the Wails app: + +```yaml +- name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} +- name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json +``` + +Please note that signing binaries with Apple could take anywhere from minutes to hours. + +## Combined workflow file: + +Here is our GitHub workflow file with Windows + macOS combined: + +```yaml +name: "example combined" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon + - name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\Monitor.exe + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +# End notes + +This guide inspired by the RiftShare project and its workflow, which is highly recommended to check out [here](https://github.com/achhabra2/riftshare/blob/main/.github/workflows/build.yaml). diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/templates.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/templates.mdx new file mode 100644 index 00000000..790e3107 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/templates.mdx @@ -0,0 +1,97 @@ +# Templates + +Wails generates projects from pre-created templates. In v1, this was a difficult to maintain set of projects that were subject to going out of date. In v2, to empower the community, a couple of new features have been added for templates: + +- Ability to generate projects from [Remote Templates](../reference/cli.mdx#remote-templates) +- Tooling to help create your own templates + +## Creating Templates + +To create a template, you can use the `wails generate template` command. To generate a default template, run: + +`wails generate template -name mytemplate` + +This creates the directory "mytemplate" with default files: + +```shell title=mytemplate/ +. +|-- NEXTSTEPS.md +|-- README.md +|-- app.tmpl.go +|-- frontend +| `-- dist +| |-- assets +| | |-- fonts +| | | |-- OFL.txt +| | | `-- nunito-v16-latin-regular.woff2 +| | `-- images +| | `-- logo-dark.svg +| |-- index.html +| |-- main.css +| `-- main.js +|-- go.mod.tmpl +|-- main.tmpl.go +|-- template.json +`-- wails.tmpl.json +``` + +### Template Overview + +The default template consists of the following files and directories: + +| Filename / Dir | Description | +| --------------- | -------------------------------------------- | +| NEXTSTEPS.md | Instructions on how to complete the template | +| README.md | The README published with the template | +| app.tmpl.go | `app.go` template file | +| frontend/ | The directory containing frontend assets | +| go.mod.tmpl | `go.mod` template file | +| main.tmpl.go | `main.go` template file | +| template.json | The template metadata | +| wails.tmpl.json | `wails.json` template file | + +At this point it is advisable to follow the steps in `NEXTSTEPS.md`. + +## Creating a Template from an Existing Project + +It's possible to create a template from an existing frontend project by passing the path to the project when generating the template. We will now walk through how to create a Vue 3 template: + +- Install the vue cli: `npm install -g @vue/cli` +- Create the default project: `vue create vue3-base` + - Select `Default (Vue 3) ([Vue 3] babel, eslint)` +- After the project has been generated, run: + +```shell +> wails generate template -name wails-vue3-template -frontend .\vue3-base\ +Extracting base template files... +Migrating existing project files to frontend directory... +Updating package.json data... +Renaming package.json -> package.tmpl.json... +Updating package-lock.json data... +Renaming package-lock.json -> package-lock.tmpl.json... +``` + +- The template may now be customised as specified in the `NEXTSTEPS.md` file +- Once the files are ready, it can be tested by running: `wails init -n my-vue3-project -t .\wails-vue3-template\` +- To test the new project, run: `cd my-vue3-project` then `wails build` +- Once the project has compiled, run it: `.\build\bin\my-vue3-project.exe` +- You should have a fully functioning Vue3 application: + +```mdx-code-block +
+ +
+``` + +## Publishing Templates + +Publishing a template is simply pushing the files to GitHub. The following best practice is encouraged: + +- Remove any unwanted files and directories (such as `.git`) from your frontend directory +- Ensure that `template.json` is complete, especially `helpurl` +- Push the files to GitHub +- Create a PR on the [Community Templates](../community/templates.mdx) page +- Announce the template on the [Template Announcement](https://github.com/wailsapp/wails/discussions/825) discussion board 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 new file mode 100644 index 00000000..82e4c35f --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -0,0 +1,162 @@ +# Troubleshooting + +An assortment of troubleshooting tips. + +## `wails` 명령어를 찾을 수 없나요? + +시스템에서 `wails` 명령어를 찾을 수 없는 경우 Go 설치 지침을 잘 따라했는지 확인해보세요. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. + +## My application is displaying a white/blank screen + +Check that your application includes the assets from the correct directory. In your `main.go` file, you will have something similar to the following code: + +```go +//go:embed all:frontend/dist +var assets embed.FS +``` + +Check that `frontend/dist` contains your application assets. + +### Mac + +If this happens on Mac, try adding the following to your `Info.plist`: + +```xml +NSAppTransportSecurity + + NSAllowsLocalNetworking + + +``` + +Reference: https://github.com/wailsapp/wails/issues/1504#issuecomment-1174317433 + +## Mac application not valid + +If your built application looks like this in finder: + +```mdx-code-block +

+ +

+``` + +it's likely that your application's `info.plist` is invalid. Update the file in `build/.app/Contents/info.plist` and check if the data is valid, EG check the binary name is correct. To persist the changes, copy the file back to the `build/darwin` directory. + +## Cannot call backend method from frontend with variadic arguments + +If you have a backend method defined with variadic parameters, eg: + +```go +func (a *App) TestFunc(msg string, args ...interface{}) error { + // Code +} +``` + +calling this method from the frontend like this will fail: + +```js +var msg = "Hello: "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, ...args) + .then((result) => { + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Workaround: + +```js +var msg = "Hello "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, args) + .then((result) => { + //without the 3 dots + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Credit: https://github.com/wailsapp/wails/issues/1186 + +## I'm having getting proxy errors when trying to install Wails + +If you are getting errors like this: + +``` +"https://proxy.golang.org/github.com/wailsapp/wails/cmd/wails/@v/list": dial tcp 172.217.163.49:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. +``` + +it's probably because the official Go Proxy is being blocked (Users in China have reported this). The solution is to set up the proxy manually, eg: + +``` +go env -w GO111MODULE=on +go env -w GOPROXY=https://goproxy.cn,direct +``` + +Source: https://github.com/wailsapp/wails/issues/1233 + +## The generated Typescript doesn't have the correct types + +Sometimes the generated Typescript doesn't have the correct types. To mitigate this, it is possible to specify what types should be generated using the `ts_type` struct tag. For more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types). + +## When I navigate away from `index.html`, I am unable to call methods on the frontend + +If you navigate away from `index.html` to a new html file, the context will be lost. This can be fixed by adding the following imports to the `` section of any new page you navigate to: + +```html + + + + +``` + +Source: https://github.com/wailsapp/wails/discussions/1512 + +## I get `too many open files` errors on my Mac when I run `wails dev` + +By default, macOS will only allow you to open a maximum of 256 files. This can affect the `wails dev` command. This limit can be increased by running: `ulimit -n 1024` in the terminal. + +FSNotify is [looking to move to Apple's fsevents](https://github.com/fsnotify/fsnotify/issues/11) for Mac. If this isn't completed soon, we will create our own implementation, tracked [here](https://github.com/wailsapp/wails/issues/1733). + +## My Mac app gives me weird compilation errors + +A few users have reported seeing compilation errors such as the following: + +```shell +# github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin +In file included from ../../pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.44.2/internal/frontend/desktop/darwin/callbacks.go:9: +In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12: +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString +- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); + ~~~~~~~~~~~~~~ ^ ~ +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT' + #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A))) +``` + +This is _normally_ due to a mismatch with the OS version you are running and the version of the XCode Command Line Tools installed. If you see an error like this, try upgrading your XCode Command Line Tools to the latest version. + +If reinstalling Xcode Command Tools still fails, you can check the path where the toolkit is located using: + +`xcode-select -p` + +If `/Applications/Xcode.app/Contents/Developer` is displayed, run `sudo xcode-select --switch /Library/Developer/CommandLineTools` + +Sources: https://github.com/wailsapp/wails/issues/1806 and https://github.com/wailsapp/wails/issues/1140#issuecomment-1290446496 + +-- + +## Cannot start service: Host version "x.x.x does not match binary version "x.x.x" + +It's preferable to add `frontend/node_modules` and `frontend/package-lock.json` to your `.gitignore`. Otherwise when opening your repository on another machine that may have different versions of Node installed, you may not be able to run your application. + +If this does happen, simply delete `frontend/node_modules` and `frontend/package-lock.json` and run your `wails build` or `wails dev` command again. \ No newline at end of file diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/vscode.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/vscode.mdx new file mode 100644 index 00000000..ed258656 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/vscode.mdx @@ -0,0 +1,82 @@ + +# Visual Studio Code + +This page is for miscellaneous tips and tricks when using Visual Studio Code with Wails. + +## Vetur Configuration + +Many thanks to [@Lyimmi](https://github.com/Lyimmi) for this tip. Originally posted [here](https://github.com/wailsapp/wails/issues/1791#issuecomment-1228158349). + +Vetur is a popular plugin for Visual Studio Code that provides syntax highlighting and code completion for Vue projects. When loading a Wails project in VSCode, Vetur will throw an error as it is expecting to find the frontend project in the root directory. To fix this, you can do the following: + +Create a file named `vetur.config.js` in the project's root. + +```javascript +// vetur.config.js +/** @type {import('vls').VeturConfig} */ +module.exports = { + // **optional** default: `{}` + // override vscode settings + // Notice: It only affects the settings used by Vetur. + settings: { + "vetur.useWorkspaceDependencies": true, + "vetur.experimental.templateInterpolationService": true + }, + // **optional** default: `[{ root: './' }]` + // support monorepos + projects: [ + { + // **required** + // Where is your project? + // It is relative to `vetur.config.js`. + // root: './packages/repo1', + root: './frontend', + // **optional** default: `'package.json'` + // Where is `package.json` in the project? + // We use it to determine the version of vue. + // It is relative to root property. + package: './package.json', + // **optional** + // Where is TypeScript config file in the project? + // It is relative to root property. + tsconfig: './tsconfig.json', + // **optional** default: `'./.vscode/vetur/snippets'` + // Where is vetur custom snippets folders? + snippetFolder: './.vscode/vetur/snippets', + // **optional** default: `[]` + // Register globally Vue component glob. + // If you set it, you can get completion by that components. + // It is relative to root property. + // Notice: It won't actually do it. You need to use `require.context` or `Vue.component` + globalComponents: [ + './src/components/**/*.vue' + ] + } + ] +} +``` + +Next, configure `frontend/tsconfig.json`: + +```javascript +{ + "compilerOptions": { + "module": "system", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "outFile": "../../built/local/tsc.js", + "allowJs": true + }, + "exclude": [ + "node_modules", + "**/*.spec.ts" + ], + "include": [ + "src/**/*", + "wailsjs/**/*.ts" + ] +} +``` +This should enable you to now use Vetur as expected. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx new file mode 100644 index 00000000..22d3aec7 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx @@ -0,0 +1,58 @@ +# NSIS installer + +```mdx-code-block +

+ +
+

+``` + +Wails는 [NSIS installer](https://nsis.sourceforge.io/)를 사용하여 Windows 인스톨러 생성을 지원합니다. + +## NSIS 설치하기 + +### Windows + +인스톨러는 [NSIS Download](https://nsis.sourceforge.io/Download) 페이지에서 사용이 가능합니다. + +만약 chocolatey 패키지 매니저를 사용한다면, 다음 스크립트를 실행하세요: + +``` +choco install nsis +``` + +만약 NSIS를 수동으로 설치하기 원한다면, NSIS가 설치된 경로에서 `makensis.exe`가 포함된 _Bin_ 폴더를 추가 해야합니다. [여기](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) Windows에서 어떻게 경로를 추가하는지에 대한 튜토리얼이 있습니다. + +### Linux + +`nsis` 패키지는 사용자의 배포판 패키지 매니저를 통해 이용이 가능합니다. + +### MacOS + +NSIS는 homebrew를 통해 설치가 가능합니다: `brew install nsis`. + +## 인스톨러 생성하기 + +새로운 프로젝트가 생성되었을때, Wails는 NSIS 설정 파일을 `build/windows/installer`에 생성합니다. 설정 데이터는 `installer/info.json`로 부터 읽어오며 이 데이터는 이 프로젝트의 `wails.json` Info 섹션에서 설정되어 사용됩니다: + +```json +// ... + "Info": { + "companyName": "My Company Name", + "productName": "Wails Vite", + "productVersion": "1.0.0", + "copyright": "Copyright.........", + "comments": "Built using Wails (https://wails.io)" + }, +``` + +애플리케이션을 위한 인스톨러를 생성하기 위해 `-nsis` 플래그를 `wails build`와 함께 사용하세요: + +``` +wails build -nsis +``` + +이제 인스톨러는 `build/bin` 디렉토리에서 이용이 가능합니다. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows.mdx new file mode 100644 index 00000000..821808c0 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/guides/windows.mdx @@ -0,0 +1,61 @@ +# Windows + +This page has miscellaneous guides related to developing Wails applications for Windows. + +## Handling the WebView2 Runtime Dependency + +Wails applications built for Windows have a runtime requirement on the Microsoft [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Windows 11 will have this installed by default, but some machines won't. Wails offers an easy approach to dealing with this dependency. + +By using the `-webview2` flag when building, you can decide what your application will do when a suitable runtime is not detected (including if the installed runtime is too old). The four options are: + +1. Download +2. Embed +3. Browser +4. Error + +### Download + +This option will prompt the user that no suitable runtime has been found and then offer to download and run the official bootstrapper from Microsoft's WebView2 site. If the user proceeds, the official bootstrapper will be downloaded and run. + +### Embed + +This option embeds the official bootstrapper within the application. If no suitable runtime has been found, the application will offer to run the bootstrapper. This adds ~150k to the binary size. + +### Browser + +This option will prompt the user that no suitable runtime has been found and then offer to open a browser to the official WebView2 page where the bootstrapper can be downloaded and installed. The application will then exit, leaving the installation up to the user. + +### Error + +If no suitable runtime is found, an error is given to the user and no further action taken. + +## Fixed version runtime + +Another way of dealing with webview2 dependency is shipping it yourself. You can download [fixed version runtime](https://developer.microsoft.com/microsoft-edge/webview2/#download-section) and bundle or download it with your application. + +Also, you should specify path to fixed version of webview2 runtime in the `windows.Options` structure when launching wails. + +```go + wails.Run(&options.App{ + Windows: &windows.Options{ + WebviewBrowserPath: "", + }, + }) +``` + +Note: When `WebviewBrowserPath` is specified, `error` strategy will be forced in case of minimal required version mismatch or invalid path to a runtime. + +## Spawning other programs + +When spawning other programs, such as scripts, you will see the window appear on the screen. To hide the window, you can use the following code: + +```go +cmd := exec.Command("your_script.exe") +cmd.SysProcAttr = &syscall.SysProcAttr{ + HideWindow: true, + CreationFlags: 0x08000000, +} +cmd.Start() +``` + +Solution provided by [sithembiso](https://github.com/sithembiso) on the [discussions board](https://github.com/wailsapp/wails/discussions/1734#discussioncomment-3386172). diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/howdoesitwork.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/howdoesitwork.mdx new file mode 100644 index 00000000..e186de89 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/howdoesitwork.mdx @@ -0,0 +1,369 @@ +--- +sidebar_position: 20 +--- + +# How does it work? + +A Wails application is a standard Go application, with a webkit frontend. The Go part of the application consists of the application code and a runtime library that provides a number of useful operations, like controlling the application window. The frontend is a webkit window that will display the frontend assets. Also available to the frontend is a Javascript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as Javascript methods that can be called, just as if they were local Javascript methods. + +```mdx-code-block +
+ +
+``` + +## The Main Application + +### Overview + +The main application consists of a single call to `wails.Run()`. It accepts the application configuration which describes the size of the application window, the window title, what assets to use, etc. A basic application might look like this: + +```go title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (b *App) startup(ctx context.Context) { + b.ctx = ctx +} + +func (b *App) shutdown(ctx context.Context) {} + +func (b *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +### Options rundown + +This example has the following options set: + +- `Title` - The text that should appear in the window's title bar +- `Width` & `Height` - The dimensions of the window +- `Assets` - The application's frontend assets +- `OnStartup` - A callback for when the window is created and is about to start loading the frontend assets +- `OnShutdown` - A callback for when the application is about to quit +- `Bind` - A slice of struct instances that we wish to expose to the frontend + +A full list of application options can be found in the [Options Reference](reference/options). + +#### Assets + +The `Assets` option is mandatory as you can't have a Wails application without frontend assets. Those assets can be any files you would expect to find in a web application - html, js, css, svg, png, etc. **There is no requirement to generate asset bundles** - plain files will do. When the application starts, it will attempt to load `index.html` from your assets and the frontend will essentially work as a browser from that point on. It is worth noting that there is no requirement on where in the `embed.FS` the files live. It is likely that the embed path uses a nested directory relative to your main application code, such as `frontend/dist`: + +```go title="main.go" +//go:embed all:frontend/dist +var assets embed.FS +``` + +At startup, Wails will iterate the embedded files looking for the directory containing `index.html`. All other assets will be loaded relative to this directory. + +As production binaries use the files contained in `embed.FS`, there are no external files required to be shipped with the application. + +When running in development mode using the `wails dev` command, the assets are loaded off disk, and any changes result in a "live reload". The location of the assets will be inferred from the `embed.FS`. + +More details can be found in the [Application Development Guide](guides/application-development.mdx). + +#### Application Lifecycle Callbacks + +Just before the frontend is about to load `index.html`, a callback is made to the function provided in [OnStartup](reference/options.mdx#onstartup). A standard Go context is passed to this method. This context is required when calling the runtime so a standard pattern is to save a reference to in this method. Just before the application shuts down, the [OnShutdown](reference/options.mdx#onshutdown) callback is called in the same way, again with the context. There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in Javascript. It is also possible to hook into the window close (or application quit) event by setting the option [OnBeforeClose](reference/options.mdx#onbeforeclose). + +#### Method Binding + +The `Bind` option is one of the most important options in a Wails application. It specifies which struct methods to expose to the frontend. Think of structs like "controllers" in a traditional web application. When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate Javascript versions of those methods that can be called by the frontend code. + +:::info Note + +Wails requires that you pass in an _instance_ of the struct for it to bind it correctly + +::: + +In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`: + +```go {16,24} title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`: + +```go {8-10} + //... + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + &mystruct1{}, + &mystruct2{}, + }, + }) + +``` + +When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following: + +- Javascript bindings for all bound methods +- Typescript declarations for all bound methods +- Typescript definitions for all Go structs used as inputs or outputs by the bound methods + +This makes it incredibly simple to call Go code from the frontend, using the same strongly typed datastructures. + +## The Frontend + +### Overview + +The frontend is a collection of files rendered by webkit. It's like a browser and webserver in one. There is virtually[^1] no limit to which frameworks or libraries you can use. The main points of interaction between the frontend and your Go code are: + +- Calling bound Go methods +- Calling runtime methods + +### Calling bound Go methods + +When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). The generated files mirror the package names in your application. In the example above, we bind `app`, which has one public method `Greet`. This will lead to the generation of the following files: + +```bash +wailsjs + └─go + └─main + ├─App.d.ts + └─App.js +``` + +Here we can see that there is a `main` package that contains the Javascript bindings for the bound `App` struct, as well as the Typescript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular Javascript function: + +```javascript +// ... +import { Greet } from "../wailsjs/go/main/App"; + +function doGreeting(name) { + Greet(name).then((result) => { + // Do something with result + }); +} +``` + +The Typescript declaration file gives you the correct types for the bound methods: + +```ts +export function Greet(arg1: string): Promise; +``` + +The generated methods return a Promise. A successful call will result in the first return value from the Go call to be passed to the `resolve` handler. An unsuccessful call is when a Go method that has an error type as it's second return value, passes an error instance back to the caller. This is passed back via the `reject` handler. In the example above, `Greet` only returns a `string` so the Javascript call will never reject - unless invalid data is passed to it. + +All data types are correctly translated between Go and Javascript. Even structs. If you return a struct from a Go call, it will be returned to your frontend as a Javascript class. + +:::info Note + +Struct fields *must* have a valid `json` tag to be included in the generated Typescript. + +Anonymous nested structs are not supported at this time. + +::: + +It is possible to send structs back to Go. Any Javascript map/class passed as an argument that is expecting a struct, will be converted to that struct type. To make this process a lot easier, in `dev` mode, a TypeScript module is generated, defining all the struct types used in bound methods. Using this module, it's possible to construct and send native Javascript objects to the Go code. + +There is also support for Go methods that use structs in their signature. All Go structs specified by a bound method (either as parameters or return types) will have Typescript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and Javascript. + +Example: We update our `Greet` method to accept a `Person` instead of a string: + +```go title="main.go" +type Person struct { + Name string `json:"name"` + Age uint8 `json:"age"` + Address *Address `json:"address"` +} + +type Address struct { + Street string `json:"street"` + Postcode string `json:"postcode"` +} + +func (a *App) Greet(p Person) string { + return fmt.Sprintf("Hello %s (Age: %d)!", p.Name, p.Age) +} +``` + +The `wailsjs/go/main/App.js` file will still have the following code: + +```js title="App.js" +export function Greet(arg1) { + return window["go"]["main"]["App"]["Greet"](arg1); +} +``` + +But the `wailsjs/go/main/App.d.ts` file will be updated with the following code: + +```ts title="App.d.ts" +import { main } from "../models"; + +export function Greet(arg1: main.Person): Promise; +``` + +As we can see, the "main" namespace is imported from a new "models.ts" file. This file contains all the struct definitions used by our bound methods. In this example, this is a `Person` struct. If we look at `models.ts`, we can see how the models are defined: + +```ts title="models.ts" +export namespace main { + export class Address { + street: string; + postcode: string; + + static createFrom(source: any = {}) { + return new Address(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.street = source["street"]; + this.postcode = source["postcode"]; + } + } + export class Person { + name: string; + age: number; + address?: Address; + + static createFrom(source: any = {}) { + return new Person(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.age = source["age"]; + this.address = this.convertValues(source["address"], Address); + } + + convertValues(a: any, classs: any, asMap: boolean = false): any { + if (!a) { + return a; + } + if (a.slice) { + return (a as any[]).map((elem) => this.convertValues(elem, classs)); + } else if ("object" === typeof a) { + if (asMap) { + for (const key of Object.keys(a)) { + a[key] = new classs(a[key]); + } + return a; + } + return new classs(a); + } + return a; + } + } +} +``` + +So long as you have TypeScript as part of your frontend build configuration, you can use these models in the following way: + +```js title="mycode.js" +import { Greet } from "../wailsjs/go/main/App"; +import { main } from "../wailsjs/go/models"; + +function generate() { + let person = new main.Person(); + person.name = "Peter"; + person.age = 27; + Greet(person).then((result) => { + console.log(result); + }); +} +``` + +The combination of generated bindings and TypeScript models makes for a powerful development environment. + +More information on Binding can be found in the [Binding Methods](guides/application-development.mdx#binding-methods) section of the [Application Development Guide](guides/application-development.mdx). + +### Calling runtime methods + +The Javascript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations: + +```js title="mycode.js" +window.runtime.EventsEmit("my-event", 1); +``` + +More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro). + +[^1]: There is a very small subset of libraries that use features unsupported in WebViews. There are often alternatives and workarounds for such cases. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/introduction.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/introduction.mdx new file mode 100644 index 00000000..a0f7e845 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/introduction.mdx @@ -0,0 +1,75 @@ +--- +sidebar_position: 1 +--- + +# 소개 + +Wails is a project that enables you to write desktop apps using Go and web technologies. + +Consider it a lightweight and fast Electron alternative for Go. You can easily build applications with the flexibility and power of Go, combined with a rich, modern frontend. + +### Features + +- Native Menus, Dialogs, Theming and Translucency +- Windows, macOS and linux support +- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS +- Easily call Go methods from Javascript +- Automatic Go struct to Typescript model generation +- No CGO or external DLLs required on Windows +- Live development mode using the power of [Vite](https://vitejs.dev/) +- Powerful CLI to easily Create, Build and Package applications +- A rich [runtime library](/docs/reference/runtime/intro) +- Applications built with Wails are Apple & Microsoft Store compliant + +This is [varly](https://varly.app) - a desktop application for MacOS & Windows written using Wails. Not only does it look great, it uses native menus and translucency - everything you'd expect from a modern native app. + +```mdx-code-block +

+ + + +

+``` + +### Quick Start Templates + +Wails comes with a number of pre-configured templates that allow you to get your application up and running quickly. There are templates for the following frameworks: Svelte, React, Vue, Preact, Lit and Vanilla. There are both Javascript and Typescript versions for each template. + +### Native Elements + +Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build good-looking, feature rich desktop applications. + +**It does not embed a browser**, so it is resource efficient. Instead, it uses the native rendering engine for the platform. On Windows, this is the new Microsoft Webview2 library, built on Chromium. + +### Go & Javascript Interoperability + +Wails automatically makes your Go methods available to Javascript, so you can call them by name from your frontend! It even generates Typescript models for the structs used by your Go methods, so you can pass the same data structures between Go and Javascript. + +### Runtime Library + +Wails provides a runtime library, for both Go and Javascript, that handles a lot of the things modern applications need, like Eventing, Logging, Dialogs, etc. + +### Live Development Experience + +#### Automatic Rebuilds + +When you run your application in "dev" mode, Wails will build your application as a native desktop application, but will read your assets from disk. It will detect any changes to your Go code and automatically rebuild and relaunch your application. + +#### Automatic Reloads + +When changes to your application assets are detected, your running application will "reload", reflecting your changes almost immediately. + +#### Develop your application in a Browser + +If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver that will run your application in any browser that connects to it. It will even refresh when your assets change on disk. + +### Production-ready Native Binaries + +When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving you total control over how your applications are built. + +### Tooling + +The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting of creating icons, compiling your application with optimal settings and delivering a distributable, production ready binary. Choose from a number of starter templates to get up and running quickly! 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 new file mode 100644 index 00000000..36f6c971 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -0,0 +1,229 @@ +--- +sidebar_position: 2 +--- + +# CLI + +The Wails CLI has a number of commands that are used for managing your projects. All commands are run in the following way: + +`wails ` + +## init + +`wails init` is used for generating projects. + +| Flag | Description | Default | +|:------------------ |:----------------------------------------------------------------------------------------------------------------------- |:-------------------:| +| -n "project name" | Name of the project. **Mandatory**. | | +| -d "project dir" | Project directory to create | Name of the project | +| -g | Initialise git repository | | +| -l | List available project templates | | +| -q | Suppress output to console | | +| -t "template name" | The project template to use. This can be the name of a default template or a URL to a remote template hosted on github. | vanilla | +| -ide | Generate IDE project files | | +| -f | Force build application | false | + +Example: `wails init -n test -d mytestproject -g -ide vscode -q` + +This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently. + +More information on using IDEs with Wails can be found [here](../guides/ides.mdx). + +### Remote Templates + +Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL. + +Example: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]` + +A list of community maintained templates can be found [here](../community/templates.mdx) + +:::warning Attention + +**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!** + +If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed. + +::: + +## build + +`wails build` is used for compiling your project to a production-ready binary. + +| Flag | Description | Default | +|:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | +| -platform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platforms) eg. `windows/arm64`. Note, if you do not give the architecture, `runtime.GOARCH` is used. | platform = `GOOS` environment variable if given else `runtime.GOOS`.
arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. | +| -clean | Cleans the `build/bin` directory | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -nopackage | Do not package application | | +| -o filename | Output filename | | +| -s | Skip building the frontend | false | +| -f | Force build application | false | +| -tags "extra tags" | Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated | | +| -upx | Compress final binary using "upx" | | +| -upxflags | Flags to pass to upx | | +| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 | +| -webview2 | WebView2 installer strategy: download,embed,browser,error | download | +| -u | Updates your project's `go.mod` to use the same version of Wails as the CLI | | +| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | false | +| -trimpath | Remove all file system paths from the resulting executable. | false | +| -race | Build with Go's race detector | false | +| -windowsconsole | Keep the console window for Windows builds | | +| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false | +| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` | + +For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide. + +If you prefer to build using standard Go tooling, please consult the [Manual Builds](../guides/manual-builds.mdx) guide. + +Example: + +`wails build -clean -o myproject.exe` + +:::Info +On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +::: + +:::info UPX on Apple Silicon + +There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon. + +::: + +:::info UPX on Windows + +Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437). + +::: + +### Platforms + +Supported platforms are: + +| Platform | Description | +|:---------------- |:--------------------------------------------- | +| darwin | MacOS + architecture of build machine | +| darwin/amd64 | MacOS 10.13+ AMD64 | +| darwin/arm64 | MacOS 11.0+ ARM64 | +| darwin/universal | MacOS AMD64+ARM64 universal application | +| windows | Windows 10/11 + architecture of build machine | +| windows/amd64 | Windows 10/11 AMD64 | +| windows/arm64 | Windows 10/11 ARM64 | +| linux | Linux + architecture of build machine | +| linux/amd64 | Linux AMD64 | +| linux/arm64 | Linux ARM64 | + +## doctor + +`wails doctor` will run diagnostics to ensure that your system is ready for development. + +Example: + +``` +Wails CLI v2.0.0-beta + +Scanning system - Please wait (this may take a long time)...Done. + +System +------ +OS: Windows 10 Pro +Version: 2009 (Build: 19043) +ID: 21H1 +Go Version: go1.18 +Platform: windows +Architecture: amd64 + +Dependency Package Name Status Version +---------- ------------ ------ ------- +WebView2 N/A Installed 93.0.961.52 +npm N/A Installed 6.14.15 +*upx N/A Installed upx 3.96 + +* - Optional Dependency + +Diagnosis +--------- +Your system is ready for Wails development! + +``` + +## dev + +`wails dev` is used to run your application in a "live development" mode. This means: + +- The application's `go.mod` will be updated to use the same version of Wails as the CLI +- The application is compiled and run automatically +- A watcher is started and will trigger a rebuild of your dev app if it detects changes to your go files +- A webserver is started on `http://localhost:34115` which serves your application (not just frontend) over http. This allows you to use your favourite browser development extensions +- All application assets are loaded from disk. If they are changed, the application will automatically reload (not rebuild). All connected browsers will also reload +- 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. + +| Flag | Description | Default | +|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- | +| -assetdir "./path/to/assets" | Serve assets from the given directory instead of using the provided asset FS | Value in `wails.json` | +| -browser | Opens a browser to `http://localhost:34115` on startup | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -e | Extensions to trigger rebuilds (comma separated) | go | +| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | | +| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | Debug | +| -noreload | Disable automatic reload when assets change | | +| -nocolour | Turn off colour cli output | false | +| -nogen | Disable generate module | | +| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 | +| -wailsjsdir | The directory to generate the generated Wails JS modules | Value in `wails.json` | +| -debounce | The time to wait for reload after an asset change is detected | 100 (milliseconds) | +| -devserver "host:port" | The address to bind the wails dev server to | "localhost:34115" | +| -frontenddevserverurl "url" | Use 3rd party dev server url to serve assets, EG Vite | "" | +| -appargs "args" | Arguments passed to the application in shell style | | +| -save | Saves the given `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` flags in `wails.json` to become the defaults for subsequent invocations. | | +| -race | Build with Go's race detector | false | +| -s | Skip building the frontend | false | + +Example: + +`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser` + +This command will do the following: + +- Build the application and run it (more details [here](../guides/manual-builds.mdx) +- Generate the Wails JS modules in `./frontend/src` +- Watch for updates to files in `./frontend/dist` and reload on any change +- Open a browser and connect to the application + +There is more information on using this feature with existing framework scripts [here](../guides/application-development.mdx#live-reloading). + +## generate + +### template + +Wails uses templates for project generation. The `wails generate template` command helps scaffold a template so that it may be used for generating projects. + +| Flag | Description | +|:---------------- |:------------------------------------------- | +| -name | The template name (Mandatory) | +| -frontend "path" | Path to frontend project to use in template | + +For more details on creating templates, consult the [Templates guide](../guides/templates.mdx). + +### module + +The `wails generate module` command allows you to manually generate the `wailsjs` directory for your application. + +## update + +`wails update` will update the version of the Wails CLI. + +| Flag | Description | +|:------------------ |:------------------------------------- | +| -pre | Update to latest pre-release version | +| -version "version" | Install a specific version of the CLI | + +## version + +`wails version` will simply output the current CLI version. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx new file mode 100644 index 00000000..304f57d6 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/menus.mdx @@ -0,0 +1,227 @@ +--- +sidebar_position: 4 +--- + +# Menus + +It is possible to add an application menu to Wails projects. This is achieved by defining a [Menu](#menu) struct and setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu). + +An example of how to create a menu: + +```go + AppMenu := menu.NewMenu() + FileMenu := AppMenu.AddSubmenu("File") + FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile) + FileMenu.AddSeparator() + FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) { + runtime.Quit() + }) + + if runtime.GOOS == "darwin" { + AppMenu.Append(menu.EditMenu()) // on macos platform, we should append EditMenu to enable Cmd+C,Cmd+V,Cmd+Z... shortcut + } + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + Menu: AppMenu, + Bind: []interface{}{ + app, + }, + ) + // ... +``` + +It is also possible to dynamically update the menu, by updating the menu struct and calling [MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu). + +The example above uses helper methods, however it's possible to build the menu structs manually. + +## Menu + +A Menu is a collection of MenuItems: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Menu struct { + Items []*MenuItem +} +``` + +For the Application menu, each MenuItem represents a single menu such as "Edit". + +A simple helper method is provided for building menus: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func NewMenuFromItems(first *MenuItem, rest ...*MenuItem) *Menu +``` + +This makes the layout of the code more like that of a menu without the need to add the menu items manually after creating them. Alternatively, you can just create the menu items and add them to the menu manually. + +## MenuItem + +A MenuItem represents an item within a Menu. + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +// MenuItem represents a menu item contained in a menu +type MenuItem struct { + Label string + Role Role + Accelerator *keys.Accelerator + Type Type + Disabled bool + Hidden bool + Checked bool + SubMenu *Menu + Click Callback +} +``` + +| Field | Type | Notes | +| ----------- | ------------------------------------ | ------------------------------------------------------------- | +| Label | string | The menu text | +| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item | +| Type | [Type](#type) | Type of MenuItem | +| Disabled | bool | Disables the menu item | +| Hidden | bool | Hides this menu item | +| Checked | bool | Adds check to item (Checkbox & Radio types) | +| SubMenu | [\*Menu](#menu) | Sets the submenu | +| Click | [Callback](#callback) | Callback function when menu clicked | +| Role | string | Defines a [role](#role) for this menu item. Mac only for now. | + +### Accelerator + +Accelerators (sometimes called keyboard shortcuts) define a binding between a keystroke and a menu item. Wails defines an Accelerator as a combination or key + [Modifier](#modifier). They are available in the `"github.com/wailsapp/wails/v2/pkg/menu/keys"` package. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut := keys.CmdOrCtrl("o") +``` + +Keys are any single character on a keyboard with the exception of `+`, which is defined as `plus`. Some keys cannot be represented as characters so there are a set of named characters that may be used: + +| | | | | +|:-----------:|:-----:|:-----:|:---------:| +| `backspace` | `f1` | `f16` | `f31` | +| `tab` | `f2` | `f17` | `f32` | +| `return` | `f3` | `f18` | `f33` | +| `enter` | `f4` | `f19` | `f34` | +| `escape` | `f5` | `f20` | `f35` | +| `left` | `f6` | `f21` | `numlock` | +| `right` | `f7` | `f22` | | +| `up` | `f8` | `f23` | | +| `down` | `f9` | `f24` | | +| `space` | `f10` | `f25` | | +| `delete` | `f11` | `f36` | | +| `home` | `f12` | `f37` | | +| `end` | `f13` | `f38` | | +| `page up` | `f14` | `f39` | | +| `page down` | `f15` | `f30` | | + +Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut, err := keys.Parse("Ctrl+Option+A") +``` + +#### Modifier + +The following modifiers are keys that may be used in combination with the accelerator key: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +const ( + // CmdOrCtrlKey represents Command on Mac and Control on other platforms + CmdOrCtrlKey Modifier = "cmdorctrl" + // OptionOrAltKey represents Option on Mac and Alt on other platforms + OptionOrAltKey Modifier = "optionoralt" + // ShiftKey represents the shift key on all systems + ShiftKey Modifier = "shift" + // ControlKey represents the control key on all systems + ControlKey Modifier = "ctrl" +) +``` + +A number of helper methods are available to create Accelerators using modifiers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +func CmdOrCtrl(key string) *Accelerator +func OptionOrAlt(key string) *Accelerator +func Shift(key string) *Accelerator +func Control(key string) *Accelerator +``` + +Modifiers can be combined using `keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines "Ctrl+Option+A" on Mac and "Ctrl+Alt+A" on Window/Linux + myShortcut := keys.Combo("a", ControlKey, OptionOrAltKey) +``` + +### Type + +Each menu item must have a type and there are 5 types available: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +const ( + TextType Type = "Text" + SeparatorType Type = "Separator" + SubmenuType Type = "Submenu" + CheckboxType Type = "Checkbox" + RadioType Type = "Radio" +) +``` + +For convenience, helper methods are provided to quickly create a menu item: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func Text(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func Separator() *MenuItem +func Radio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func Checkbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func SubMenu(label string, menu *Menu) *Menu +``` + +You can also create menu items directly on a menu by using the "Add" helpers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func (m *Menu) AddText(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSeparator() *MenuItem +func (m *Menu) AddRadio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddCheckbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSubMenu(label string, menu *Menu) *MenuI +``` + +A note on radio groups: A radio group is defined as a number of radio menu items that are next to each other in the menu. This means that you do not need to group items together as it is automatic. However, that also means you cannot have 2 radio groups next to each other - there must be a non-radio item between them. + +### Callback + +Each menu item may have a callback that is executed when the item is clicked: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Callback func(*CallbackData) + +type CallbackData struct { + MenuItem *MenuItem +} +``` + +The function is given a `CallbackData` struct which indicates which menu item triggered the callback. This is useful when using radio groups that may share a callback. + +### Role + +:::info Roles + +Roles are currently supported on Mac only. + +::: + +A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles: + +| Role | Description | +| ------------ | ------------------------------------------------------------------------ | +| AppMenuRole | The standard Mac application menu. Can be created using `menu.AppMenu()` | +| EditMenuRole | The standard Mac edit menu. Can be created using `menu.EditMenu()` | 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 new file mode 100644 index 00000000..a42d4442 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -0,0 +1,736 @@ +--- +sidebar_position: 3 +--- + +# Options + +## Application Options + +The `Options.App` struct contains the application configuration. It is passed to the `wails.Run()` method: + +```go title="Example" +import ( + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "github.com/wailsapp/wails/v2/pkg/options/linux" + "github.com/wailsapp/wails/v2/pkg/options/mac" + "github.com/wailsapp/wails/v2/pkg/options/windows" +) + +func main() { + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + DisableResize: false, + Fullscreen: false, + WindowStartState: options.Maximised, + Frameless: true, + MinWidth: 400, + MinHeight: 400, + MaxWidth: 1280, + MaxHeight: 1024, + StartHidden: false, + HideWindowOnClose: false, + BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255}, + AlwaysOnTop: false, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: assetsHandler, + Middleware: assetsMidldeware, + }, + Menu: app.applicationMenu(), + Logger: nil, + LogLevel: logger.DEBUG, + LogLevelProduction: logger.ERROR, + OnStartup: app.startup, + OnDomReady: app.domready, + OnShutdown: app.shutdown, + OnBeforeClose: app.beforeClose, + CSSDragProperty: "--wails-draggable", + CSSDragValue: "drag", + ZoomFactor: 1.0, + IsZoomControlEnabled: false, + Bind: []interface{}{ + app, + }, + Windows: &windows.Options{ + WebviewIsTransparent: false, + WindowIsTranslucent: false, + BackdropType: windows.Mica, + DisableWindowIcon: false, + DisableFramelessWindowDecorations: false, + WebviewUserDataPath: "", + WebviewBrowserPath: "", + Theme: windows.SystemDefault, + CustomTheme: &windows.ThemeSettings{ + DarkModeTitleBar: windows.RGB(20, 20, 20), + DarkModeTitleText: windows.RGB(200, 200, 200), + DarkModeBorder: windows.RGB(20, 0, 20), + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + }, + // User messages that can be customised + Messages *windows.Messages + // OnSuspend is called when Windows enters low power mode + OnSuspend func() + // OnResume is called when Windows resumes from low power mode + OnResume func() + }, + Mac: &mac.Options{ + TitleBar: &mac.TitleBar{ + TitlebarAppearsTransparent: true, + HideTitle: false, + HideTitleBar: false, + FullSizeContent: false, + UseToolbar: false, + HideToolbarSeparator: true, + }, + Appearance: mac.NSAppearanceNameDarkAqua, + WebviewIsTransparent: true, + WindowIsTranslucent: false, + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + Linux: &linux.Options{ + Icon: icon, + WindowIsTranslucent: false, + }, + Debug: options.Debug{ + OpenInspectorOnStartup: false, + }, + }) + + if err != nil { + log.Fatal(err) + } +} + +``` + +### Title + +The text shown in the window's title bar. + +Name: Title
Type: `string` + +### Width + +The initial width of the window. + +Name: Width
Type: `int`
Default: 1024. + +### Height + +The initial height of the window. + +Name: Height
Type: `int`
Default: 768 + +### DisableResize + +By default, the main window is resizable. Setting this to `true` will keep it a fixed size. + +Name: DisableResize
Type: `bool` + +### Fullscreen + +Deprecated: Please use [WindowStartState](#windowstartstate). + +### WindowStartState + +Defines how the window should present itself at startup. + +| Value | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +Name: WindowStartState
Type: `options.WindowStartState` + +### Frameless + +When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx). + +Name: Frameless
Type: `bool` + +### MinWidth + +This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default. + +Name: MinWidth
Type: `int` + +### MinHeight + +This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default. + +Name: MinHeight
Type: `int` + +### MaxWidth + +This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default. + +Name: MaxWidth
Type: `int` + +### MaxHeight + +This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default. + +Name: MaxHeight
Type: `int` + +### StartHidden + +When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called. + +Name: StartHidden
Type: `bool` + +### HideWindowOnClose + +By default, closing the window will close the application. Setting this to `true` means closing the window will + +hide the window instead. + +Name: HideWindowOnClose
Type: `bool` + +### BackgroundColour + +This value is the default background colour of the window. Example: options.NewRGBA(255,0,0,128) - Red at 50% transparency + +Name: BackgroundColour
Type: `*options.RGBA`
Default: white + +### AlwaysOnTop + +Indicates that the window should stay above other windows when losing focus. + +Name: AlwaysOnTop
Type: `bool` + +### Assets + +Deprecated: Please use Assets on [AssetServer specific options](#assetserver). + +### AssetsHandler + +Deprecated: Please use AssetsHandler on [AssetServer specific options](#assetserver). + +### AssetServer + +This defines AssetServer specific options. It allows to customize the AssetServer with static assets, serving assets dynamically with an `http.Handler` or hook into the request chain with an `assetserver.Middleware`. + +Not all features of an `http.Request` are currently supported, please see the following feature matrix: + +| Feature | Win | Mac | Lin | +| ----------------------- | --- | --- | --- | +| GET | ✅ | ✅ | ✅ | +| POST | ✅ | ✅ | ❌ | +| PUT | ✅ | ✅ | ❌ | +| PATCH | ✅ | ✅ | ❌ | +| DELETE | ✅ | ✅ | ❌ | +| Request Headers | ✅ | ✅ | ❌ | +| Request Body | ✅ | ✅ | ❌ | +| Request Body Streaming | ❌ | ❌ | ❌ | +| Response StatusCodes | ✅ | ✅ | ❌ | +| Response Headers | ✅ | ✅ | ❌ | +| Response Body | ✅ | ✅ | ✅ | +| Response Body Streaming | ❌ | ❌ | ✅ | +| WebSockets | ❌ | ❌ | ❌ | + +NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support. + +Name: AssetServer
Type: `*assetserver.Options` + +#### Assets + +The static frontend assets to be used by the application. + +A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. + +If set to nil, all GET requests will be forwarded to [Handler](#handler). + +Name: Assets
Type: `fs.FS` + +#### Handler + +The assets handler is a generic `http.Handler` for fallback handling of assets that can't be found. + +The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. If not defined, the result is the following in cases where the Handler would have been called: + +- GET request: `http.StatusNotFound` +- Other request: `http.StatusMethodNotAllowed` + +NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension. + +Name: AssetsHandler
Type: `http.Handler` + +#### Middleware + +Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default request handler dynamically, e.g. implement specialized Routing etc. The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default handler used by the AssetServer as an argument. + +If not defined, the default AssetServer request chain is executed. + +Name: Middleware
Type: `assetserver.Middleware` + +### Menu + +The menu to be used by the application. More details about Menus in the [Menu Reference](../reference/runtime/menu.mdx). + +:::note + +On Mac, if no menu is specified, a default menu will be created. + +::: + +Name: Menu
Type: `*menu.Menu` + +### Logger + +The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: Logger
Type: `logger.Logger`
Default: Logs to Stdout + +### LogLevel + +The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevel
Type: `logger.LogLevel`
Default: `Info` in dev mode, `Error` in production mode + +### LogLevelProduction + +The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevelProduction
Type: `logger.LogLevel`
Default: `Error` + +### OnStartup + +This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context. + +Name: OnStartup
Type: `func(ctx context.Context)` + +### OnDomReady + +This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context. + +Name: OnDomReady
Type: `func(ctx context.Context)` + +### OnShutdown + +This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context. + +Name: OnShutdown
Type: `func(ctx context.Context)` + +### OnBeforeClose + +If this callback is set, it will be called when the application is about to quit, either by clicking the window close button or calling `runtime.Quit`. Returning true will cause the application to continue, false will continue shutdown as normal. This is good for confirming with the user that they wish to exit the program. + +Example: + +```go title=windowsapp.go +func (b *App) beforeClose(ctx context.Context) (prevent bool) { + dialog, err := runtime.MessageDialog(ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Quit?", + Message: "Are you sure you want to quit?", + }) + + if err != nil { + return false + } + return dialog != "Yes" +} +``` + +Name: OnBeforeClose
Type: `func(ctx context.Context) bool` + +### CSSDragProperty + +Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`. + +Name: CSSDragProperty
Type: `string` + +### CSSDragValue + +Indicates what value the `CSSDragProperty` style should have to drag the window. Default: `drag`. + +Name: CSSDragValue
Type: `string` + +### ZoomFactor + +Name: ZoomFactor
Type: `float64` + +This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. + +### IsZoomControlEnabled + +Name: IsZoomControlEnabled
Type: `bool` + +This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar). + +### Bind + +A slice of struct instances defining methods that need to be bound to the frontend. + +Name: Bind
Type: `[]interface{}` + +### Windows + +This defines [Windows specific options](#windows). + +Name: Windows
Type: `*windows.Options` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent). + +For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw) method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the newer translucency types that are much faster. By default, the type of translucency used will be determined by Windows. To configure this, use the [BackdropType](#BackdropType) option. + +Name: WindowIsTranslucent
Type: `bool` + +#### BackdropType + +:::note + +Requires Windows 11 build 22621 or later. + +::: + +Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`. + +Name: BackdropType
Type `windows.BackdropType` + +The value can be one of the following: + +| Value | Description | +| ------- | ----------------------------------------------------------------------------------------- | +| Auto | Let Windows decide which backdrop to use | +| None | Do not use translucency | +| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect | +| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect | +| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | + +#### DisableWindowIcon + +Setting this to `true` will remove the icon in the top left corner of the title bar. + +Name: DisableWindowIcon
Type: `bool` + +#### DisableFramelessWindowDecorations + +Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11. + +Name: DisableFramelessWindowDecorations
Type: `bool` + +#### WebviewUserDataPath + +This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used. + +Name: WebviewUserDataPath
Type: `string` + +#### WebviewBrowserPath + +This defines the path to a directory with WebView2 executable files and libraries. If empty, webview2 installed in the system will be used. + +Important information about distribution of fixed version runtime: + +- [How to get and extract runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode) +- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version) +- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions) + +Name: WebviewBrowserPath
Type: `string` + +#### Theme + +Minimum Windows Version: Windows 10 2004/20H1 + +This defines the theme that the application should use: + +| Value | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| SystemDefault | _Default_. The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting | +| Dark | The application will use a dark theme exclusively | +| Light | The application will use a light theme exclusively | + +Name: Theme
Type: `windows.Theme` + +#### CustomTheme + +:::note + +Minimum Windows Version: Windows 10/11 2009/21H2 Build 22000 + +::: + +Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive. + +Name: CustomTheme
Type: `windows.CustomTheme` + +##### CustomTheme type + +The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`. + +NOTE: Any value not provided will default to black. + +```go +type ThemeSettings struct { + DarkModeTitleBar int32 + DarkModeTitleBarInactive int32 + DarkModeTitleText int32 + DarkModeTitleTextInactive int32 + DarkModeBorder int32 + DarkModeBorderInactive int32 + LightModeTitleBar int32 + LightModeTitleBarInactive int32 + LightModeTitleText int32 + LightModeTitleTextInactive int32 + LightModeBorder int32 + LightModeBorderInactive int32 +} +``` + +Example: + +```go + CustomTheme: &windows.ThemeSettings{ + // Theme to use when window is active + DarkModeTitleBar: windows.RGB(255, 0, 0), // Red + DarkModeTitleText: windows.RGB(0, 255, 0), // Green + DarkModeBorder: windows.RGB(0, 0, 255), // Blue + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + // Theme to use when window is inactive + DarkModeTitleBarInactive: windows.RGB(128, 0, 0), + DarkModeTitleTextInactive: windows.RGB(0, 128, 0), + DarkModeBorderInactive: windows.RGB(0, 0, 128), + LightModeTitleBarInactive: windows.RGB(100, 100, 100), + LightModeTitleTextInactive: windows.RGB(10, 10, 10), + LightModeBorderInactive: windows.RGB(100, 100, 100), + }, +``` + +#### Messages + +A struct of strings used by the webview2 installer if a valid webview2 runtime is not found. + +Name: Messages
Type: `*windows.Messages` + +Customise this for any language you choose to support. + +#### ResizeDebounceMS + +ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can. + +Name: ResizeDebounceMS
Type: `uint16` + +#### OnSuspend + +If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate) + +Name: OnSuspend
Type: `func()` + +#### OnResume + +If set, this function will be called when Windows resumes from low power mode (suspend/hibernate) + +Name: OnResume
Type: `func()` + +### Mac + +This defines [Mac specific options](#mac). + +Name: Mac
Type: `*mac.Options` + +#### TitleBar + +The TitleBar struct provides the ability to configure the look and feel of the title bar. + +Name: TitleBar
Type: [`*mac.TitleBar`](#titlebar-struct) + +##### Titlebar struct + +The titlebar of the application can be customised by using the TitleBar options: + +```go +type TitleBar struct { + TitlebarAppearsTransparent bool + HideTitle bool + HideTitleBar bool + FullSizeContent bool + UseToolbar bool + HideToolbarSeparator bool +} +``` + +| Name | Description | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| TitlebarAppearsTransparent | Makes the titlebar transparent. This has the effect of hiding the titlebar and the content fill the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc) | +| HideTitle | Hides the title of the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc) | +| HideTitleBar | Removes [NSWindowStyleMaskTitled](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktitled/) from the style mask | +| FullSizeContent | Makes the webview fill the entire window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemaskfullsizecontentview) | +| UseToolbar | Adds a default toolbar to the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar?language=objc) | +| HideToolbarSeparator | Removes the line beneath the toolbar. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar/1516954-showsbaselineseparator?language=objc) | + +Preconfigured titlebar settings are available: + +| Setting | Example | +| --------------------------- | ---------------------------------------------- | +| `mac.TitleBarDefault()` | ![](/img/reference/titlebar-default.webp) | +| `mac.TitleBarHidden()` | ![](/img/reference/titlebar-hidden.webp) | +| `mac.TitleBarHiddenInset()` | ![](/img/reference/titlebar-hidden-inset.webp) | + +Example: + +```go +Mac: &mac.Options{ + TitleBar: mac.TitleBarHiddenInset(), +} +``` + +Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on customising the titlebar. + +#### Appearance + +Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names. + +Name: Appearance
Type: [`mac.AppearanceType`](#appearance-type) + +##### Appearance type + +You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc). + +| Value | Description | +| ----------------------------------------------------- | --------------------------------------------------------------- | +| DefaultAppearance | DefaultAppearance uses the default system value | +| NSAppearanceNameAqua | The standard light system appearance | +| NSAppearanceNameDarkAqua | The standard dark system appearance | +| NSAppearanceNameVibrantLight | The light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastAqua | A high-contrast version of the standard light system appearance | +| NSAppearanceNameAccessibilityHighContrastDarkAqua | A high-contrast version of the standard dark system appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantLight | A high-contrast version of the light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantDark | A high-contrast version of the dark vibrant appearance | + +Example: + +```go +Mac: &mac.Options{ + Appearance: mac.NSAppearanceNameDarkAqua, +} +``` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications. + +Name: WindowIsTranslucent
Type: `bool` + +#### About + +This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role. + +Name: About
Type: [`*mac.AboutInfo`](#about-struct) + +##### About struct + +```go + +type AboutInfo struct { + Title string + Message string + Icon []byte +} +``` + +If these settings are provided, an "About" menu item will appear in the app menu (when using the `AppMenu` role). Given this configuration: + +```go +//go:embed build/appicon.png +var icon []byte + +func main() { + err := wails.Run(&options.App{ + ... + Mac: &mac.Options{ + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + }) +``` + +The "About" menu item will appear in the app menu: + +```mdx-code-block +
+ +
+
+``` + +When clicked, that will open an about message box: + +```mdx-code-block +
+ +
+
+``` + +### Linux + +This defines [Linux specific options](#linux). + +Name: Linux
Type: `*linux.Options` + +#### Icon + +Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified). + +Name: Icon
Type: `[]byte` + +Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. + +NOTE: Gnome on Wayland at least does not display this icon. To have a application icon there, a `.desktop` file has to be used. On KDE it should work. + +The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality. + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window. + +Name: WindowIsTranslucent
Type: `bool` + +### Debug + +This defines [Debug specific options](#Debug) that apply to debug builds. + +Name: Debug
Type: `options.Debug` + +#### OpenInspectorOnStartup + +Setting this to `true` will open the WebInspector on startup of the application. + +Name: OpenInspectorOnStartup
Type: `bool` 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 new file mode 100644 index 00000000..f573a4ad --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -0,0 +1,57 @@ +--- +sidebar_position: 5 +--- + +# Project Config + +The project config resides in the `wails.json` file in the project directory. The structure of the config is: + +```json +{ + "name": "[The project name]", + "assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]", + "reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]", + "build:dir": "[The directory where the build files reside. Defaults to 'build']", + "frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']", + "frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]", + "frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]", + "frontend:dev": "[This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build]", + "frontend:dev:build": "[This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev]", + "frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]", + "frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]", + "frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output]", + "wailsjsdir": "[Relative path to the directory that the auto-generated JS modules will be created]", + "version": "[Project config version]", + "outputfilename": "[The name of the binary]", + "debounceMS": 100, // The default time the dev server waits to reload when it detects a change in assets + "devServer": "[Address to bind the wails dev sever to. Default: localhost:34115]", + "appargs": "[Arguments passed to the application in shell style when in dev mode]", + "runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS. + "preBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]" + }, + "postBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]" + }, + "info": { // Data used to populate manifests and version info. + "companyName": "[The company name. Default: [The project name]]", + "productName": "[The product name. Default: [The project name]]", + "productVersion": "[The version of the product. Default: '1.0.0']", + "copyright": "[The copyright of the product. Default: 'Copyright.........']", + "comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']" + }, + "nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple']", + "obfuscated": "[Whether the app should be obfuscated. Default: false]", + "garbleargs": "[The arguments to pass to the garble command when using the obfuscated flag]" +} +``` + +This file is read by the Wails CLI when running `wails build` or `wails dev`. + +The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs. + +The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json). diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx new file mode 100644 index 00000000..b8eef677 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +--- + +# 브라우저 + +이 메소드들은 시스템 브라우저와 관련 있습니다. + +### BrowserOpenURL + +시스템 브라우저에서 URL을 엽니다. + +Go: `BrowserOpenURL(ctx context.Context, url string)`
JS: `BrowserOpenURL(url string)` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx new file mode 100644 index 00000000..cf7bf37b --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx @@ -0,0 +1,302 @@ +--- +sidebar_position: 5 +--- + +# Dialog + +This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes. + +:::info Javascript + +Dialog is currently unsupported in the JS runtime. + +::: + +### OpenDirectoryDialog + +Opens a dialog that prompts the user to select a directory. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected directory (blank if the user cancelled) or an error + +### OpenFileDialog + +Opens a dialog that prompts the user to select a file. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected file (blank if the user cancelled) or an error + +### OpenMultipleFilesDialog + +Opens a dialog that prompts the user to select multiple files. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)` + +Returns: Selected files (nil if the user cancelled) or an error + +### SaveFileDialog + +Opens a dialog that prompts the user to select a filename for the purposes of saving. Can be customised using [SaveDialogOptions](#savedialogoptions). + +Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)` + +Returns: The selected file (blank if the user cancelled) or an error + +### MessageDialog + +Displays a message using a message dialog. Can be customised using [MessageDialogOptions](#messagedialogoptions). + +Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)` + +Returns: The text of the selected button or an error + +## Options + +### OpenDialogOptions + +```go +type OpenDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + ResolvesAliases bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| ResolvesAliases | If true, returns the file not the alias | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### SaveDialogOptions + +```go +type SaveDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### MessageDialogOptions + +```go +type MessageDialogOptions struct { + Type DialogType + Title string + Message string + Buttons []string + DefaultButton string + CancelButton string +} +``` + +| Field | Description | Win | Mac | Lin | +| ------------- | -------------------------------------------------------------------------- | -------------- | --- | --- | +| Type | The type of message dialog, eg question, info... | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| Message | The message to show the user | ✅ | ✅ | ✅ | +| Buttons | A list of button titles | | ✅ | | +| DefaultButton | The button with this text should be treated as default. Bound to `return`. | ✅[*](#windows) | ✅ | | +| CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | | + +#### Windows + +Windows has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue". + +For Question dialogs, the default button is "Yes" and the cancel button is "No". This can be changed by setting the `DefaultButton` value to `"No"`. + +Example: +```go + result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Question", + Message: "Do you want to continue?", + DefaultButton: "No", + }) +``` + +#### Linux + +Linux has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Yes", "No" + +#### Mac + +A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button is considered default and is bound to the `return` key. + +For the following code: + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, +}) +``` + +the first button is shown as default: + +```mdx-code-block +
+ +
+
+``` + +And if we specify `DefaultButton` to be "two": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", +}) +``` + +the second button is shown as default. When `return` is pressed, the value "two" is returned. + +```mdx-code-block +
+ +
+
+``` + +If we now specify `CancelButton` to be "three": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", + CancelButton: "three", +}) +``` + +the button with "three" is shown at the bottom of the dialog. When `escape` is pressed, the value "three" is returned: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### DialogType + +```go +const ( + InfoDialog DialogType = "info" + WarningDialog DialogType = "warning" + ErrorDialog DialogType = "error" + QuestionDialog DialogType = "question" + ) +``` + +### FileFilter + +```go +type FileFilter struct { + DisplayName string // Filter information EG: "Image Files (*.jpg, *.png)" + Pattern string // semi-colon separated list of extensions, EG: "*.jpg;*.png" +} +``` + +#### Windows + +Windows allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Linux + +Linux allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Mac + +Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided, Wails will use all the Patterns defined. + +Example: + +```go + selection, err := runtime.OpenFileDialog(b.ctx, runtime.OpenDialogOptions{ + Title: "Select File", + Filters: []runtime.FileFilter{ + { + DisplayName: "Images (*.png;*.jpg)", + Pattern: "*.png;*.jpg", + }, { + DisplayName: "Videos (*.mov;*.mp4)", + Pattern: "*.mov;*.mp4", + }, + }, + }) +``` + +This will result in the Open File dialog using `*.png,*.jpg,*.mov,*.mp4` as a filter. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx new file mode 100644 index 00000000..373a65d7 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# Events + +The Wails runtime provides a unified events system, where events can be emitted or received by either Go or Javascript. Optionally, data may be passed with the events. Listeners will receive the data in the local data types. + +### EventsOn + +This method sets up a listener for the given event name. When an event of type `eventName` is [emitted](#EventsEmit), the callback is triggered. Any additional data sent with the emitted event will be passed to the callback. It returns a function to cancel the listener. + +Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOff + +This method unregisters the listener for the given event name, optionally multiple listeneres can be unregistered via `additionalEventNames`. + +Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...string)`
JS: `EventsOff(eventName string, ...additionalEventNames)` + +### EventsOnce + +This method sets up a listener for the given event name, but will only trigger once. It returns a function to cancel the listener. + +Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOnMultiple + +This method sets up a listener for the given event name, but will only trigger a maximum of `counter` times. It returns a function to cancel the listener. + +Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`
JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void` + +### EventsEmit + +This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners. + +Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`
JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx new file mode 100644 index 00000000..b71759a0 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx @@ -0,0 +1,84 @@ +--- +sidebar_position: 1 +--- + +# 소개 + +The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime and the aim is to try and keep them at parity where possible. + +It has utility methods for: + +- [Window](window.mdx) +- [Menu](menu.mdx) +- [Dialog](dialog.mdx) +- [Events](events.mdx) +- [Browser](browser.mdx) +- [Log](log.mdx) + +The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package take a context as the first parameter. This context should be obtained from the [OnStartup](../options.mdx#onstartup) or [OnDomReady](../options.mdx#ondomready) hooks. + +:::info Note + +Whilst the context will be provided to the [OnStartup](../options.mdx#onstartup) method, there's no guarantee the runtime will work in this method as the window is initialising in a different thread. If you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ondomready). + +::: + +The Javascript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev` mode that provides Typescript declarations for the runtime. This should be located in the `wailsjs` directory in your frontend directory. + +### Hide + +Go: `Hide(ctx context.Context)`
JS: `Hide()` + +Hides the application. + +:::info Note + +On Mac, this will hide the application in the same way as the `Hide` menu item in standard Mac applications. This is different to hiding the window, but the application still being in the foreground. For Windows and Linux, this is currently the same as `WindowHide`. + +::: + +### Show + +Shows the application. + +:::info Note + +On Mac, this will bring the application back into the foreground. For Windows and Linux, this is currently the same as `WindowShow`. + +::: + +Go: `Show(ctx context.Context)`
JS: `Show()` + +### Quit + +Quits the application. + +Go: `Quit(ctx context.Context)`
JS: `Quit()` + +### Environment + +Returns details of the current environment. + +Go: `Environment(ctx context.Context) EnvironmentInfo`
JS: `Environment(): Promise` + +#### EnvironmentInfo + +Go: + +```go +type EnvironmentInfo struct { + BuildType string + Platform string + Arch string +} +``` + +JS: + +```ts +interface EnvironmentInfo { + buildType: string; + platform: string; + arch: string; +} +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx new file mode 100644 index 00000000..e5e6ea7a --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 3 +--- + +# Log + +The Wails runtime provides a logging mechanism that may be called from Go or Javascript. Like most loggers, there are a number of log levels: + +- Trace +- Debug +- Info +- Warning +- Error +- Fatal + +The logger will output any log message at the current, or higher, log level. Example: The `Debug` log level will output all messages except `Trace` messages. + +### LogPrint + +Logs the given message as a raw message. + +Go: `LogPrint(ctx context.Context, message string)`
JS: `LogPrint(message: string)` + +### LogPrintf + +Logs the given message as a raw message. + +Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`
+ +### LogTrace + +Logs the given message at the `Trace` log level. + +Go: `LogTrace(ctx context.Context, message string)`
JS: `LogTrace(message: string)` + +### LogTracef + +Logs the given message at the `Trace` log level. + +Go: `LogTracef(ctx context.Context, format string, args ...interface{})`
+ +### LogDebug + +Logs the given message at the `Debug` log level. + +Go: `LogDebug(ctx context.Context, message string)`
JS: `LogDebug(message: string)` + +### LogDebugf + +Logs the given message at the `Debug` log level. + +Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`
+ +### LogInfo + +Logs the given message at the `Info` log level. + +Go: `LogInfo(ctx context.Context, message string)`
JS: `LogInfo(message: string)` + +### LogInfof + +Logs the given message at the `Info` log level. + +Go: `LogInfof(ctx context.Context, format string, args ...interface{})`
+ +### LogWarning + +Logs the given message at the `Warning` log level. + +Go: `LogWarning(ctx context.Context, message string)`
JS: `LogWarning(message: string)` + +### LogWarningf + +Logs the given message at the `Warning` log level. + +Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`
+ +### LogError + +Logs the given message at the `Error` log level. + +Go: `LogError(ctx context.Context, message string)`
JS: `LogError(message: string)` + +### LogErrorf + +Logs the given message at the `Error` log level. + +Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`
+ +### LogFatal + +Logs the given message at the `Fatal` log level. + +Go: `LogFatal(ctx context.Context, message string)`
JS: `LogFatal(message: string)` + +### LogFatalf + +Logs the given message at the `Fatal` log level. + +Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`
+ +### LogSetLogLevel + +Sets the log level. In Javascript, the number relates to the following log levels: + +| Value | Log Level | +| ----- | --------- | +| 1 | Trace | +| 2 | Debug | +| 3 | Info | +| 4 | Warning | +| 5 | Error | + +Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`
JS: `LogSetLogLevel(level: number)` + +## Using a Custom Logger + +A custom logger may be used by providing it using the [Logger](../options.mdx#logger) application option. The only requirement is that the logger implements the `logger.Logger` interface defined in `github.com/wailsapp/wails/v2/pkg/logger`: + +```go title="logger.go" +type Logger interface { + Print(message string) + Trace(message string) + Debug(message string) + Info(message string) + Warning(message string) + Error(message string) + Fatal(message string) +} +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx new file mode 100644 index 00000000..85c6ab12 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx @@ -0,0 +1,25 @@ +--- +sidebar_position: 6 +--- + +# 메뉴 + +애플리케이션 메뉴는 이 메소드들과 관련 있습니다. + +:::info Javascript + +현재 메뉴는 JS runtime을 지원하지 않습니다. + +::: + +### MenuSetApplicationMenu + +애플리케이션 메뉴는 [menu](../menus.mdx)를 통해 설정하세요. + +Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)` + +### MenuUpdateApplicationMenu + +애플리케이션 메뉴를 업데이트하여 `MenuSetApplicationMenu`에 전달된 메뉴에 대한 모든 변경 사항을 선택합니다. + +Go: `MenuUpdateApplicationMenu(ctx context.Context)` 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 new file mode 100644 index 00000000..9eeee137 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -0,0 +1,221 @@ +--- +sidebar_position: 4 +--- + +# Window + +These methods give control of the application window. + +### WindowSetTitle + +Sets the text in the window title bar. + +Go: `WindowSetTitle(ctx context.Context, title string)`
JS: `WindowSetTitle(title: string)` + +### WindowFullscreen + +Makes the window full screen. + +Go: `WindowFullscreen(ctx context.Context)`
JS: `WindowFullscreen()` + +### WindowUnfullscreen + +Restores the previous window dimensions and position prior to full screen. + +Go: `WindowUnfullscreen(ctx context.Context)`
JS: `WindowUnfullscreen()` + +### WindowIsFullscreen + +Returns true if the window is full screen. + +Go: `WindowIsFullscreen(ctx context.Context) bool`
JS: `WindowIsFullscreen() bool` + +### WindowCenter + +Centers the window on the monitor the window is currently on. + +Go: `WindowCenter(ctx context.Context)`
JS: `WindowCenter()` + +### WindowExecJS + +Executes arbitrary JS code in the window. + +This method runs the code in the browser asynchronously and returns immediately. If the script causes any errors, they will only be available in the browser console. + +Go: `WindowExecJS(ctx context.Context, js string)` + +### WindowReload + +Performs a "reload" (Reloads current page). + +Go: `WindowReload(ctx context.Context)`
JS: `WindowReload()` + +### WindowReloadApp + +Reloads the application frontend. + +Go: `WindowReloadApp(ctx context.Context)`
JS: `WindowReloadApp()` + +### WindowSetSystemDefaultTheme + +Windows only. + +Go: `WindowSetSystemDefaultTheme(ctx context.Context)`
JS: `WindowSetSystemDefaultTheme()` + +Sets window theme to system default (dark/light). + +### WindowSetLightTheme + +Windows only. + +Go: `WindowSetLightTheme(ctx context.Context)`
JS: `WindowSetLightTheme()` + +Sets window theme to light. + +### WindowSetDarkTheme + +Windows only. + +Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` + +Sets window theme to dark. + +### WindowShow + +Shows the window, if it is currently hidden. + +Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` + +### WindowHide + +Hides the window, if it is currently visible. + +Go: `WindowHide(ctx context.Context)`
JS: `WindowHide()` + +### WindowIsNormal + +Returns true if the window not minimised, maximised or fullscreen. + +Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` + +### WindowSetSize + +Sets the width and height of the window. + +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` + +### WindowGetSize + +Gets the width and height of the window. + +Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `WindowGetSize() : Size` + +### WindowSetMinSize + +Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` + +### WindowSetMaxSize + +Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` + +### WindowSetAlwaysOnTop + +Sets the window AlwaysOnTop or not on top. + +Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlwaysOnTop(b: Boolen)` + +### WindowSetPosition + +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)` + +### WindowGetPosition + +Gets the window position relative to the monitor the window is currently on. + +Go: `WindowGetPosition(ctx context.Context) (x int, y int)`
JS: `WindowGetPosition() : Position` + +### WindowMaximise + +Maximises the window to fill the screen. + +Go: `WindowMaximise(ctx context.Context)`
JS: `WindowMaximise()` + +### WindowUnmaximise + +Restores the window to the dimensions and position prior to maximising. + +Go: `WindowUnmaximise(ctx context.Context)`
JS: `WindowUnmaximise()` + +### WindowIsMaximised + +Returns true if the window is maximised. + +Go: `WindowIsMaximised(ctx context.Context) bool`
JS: `WindowIsMaximised() bool` + +### WindowToggleMaximise + +Toggles between Maximised and UnMaximised. + +Go: `WindowToggleMaximise(ctx context.Context)`
JS: `WindowToggleMaximise()` + +### WindowMinimise + +Minimises the window. + +Go: `WindowMinimise(ctx context.Context)`
JS: `WindowMinimise()` + +### WindowUnminimise + +Restores the window to the dimensions and position prior to minimising. + +Go: `WindowUnminimise(ctx context.Context)`
JS: `WindowUnminimise()` + +### WindowIsMinimised + +Returns true if the window is minimised. + +Go: `WindowIsMinimised(ctx context.Context) bool`
JS: `WindowIsMinimised() bool` + +### WindowSetBackgroundColour + +Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. + +Valid values for R, G, B and A are 0-255. + +:::info Windows + +On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255. + +::: + +Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` + +## Typescript Object Definitions + +### Position + +```ts +interface Position { + x: number; + y: number; +} +``` + +### Size + +```ts +interface Size { + w: number; + h: number; +} +``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx b/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx new file mode 100644 index 00000000..1af16f77 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx @@ -0,0 +1,245 @@ +--- +sidebar_position: 20 +--- + +# Dogs API + +```mdx-code-block +
+ +
+
+``` + +:::note + +This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples). + +::: + +In this tutorial we are going to develop an application that retrieves photos of dogs from the web and then displays them. + +### Create the project + +Let's create the application. From a terminal enter: `wails init -n dogs-api -t svelte` + +Note: We could optionally add `-ide vscode` or `-ide goland` to the end of this command if you wanted to add IDE support. + +Now let's `cd dogs-api` and start editing the project files. + +### Remove unused code + +We will start by removing some elements that we know we will not use: + +- Open `app.go` and remove the following lines: + +```go +// Greet returns a greeting for the given name +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s, It's show time!", name) +} +``` + +- Open `frontend/src/App.svelte` and delete all lines. +- Delete the `frontend/src/assets/images/logo-universal.png` file + +### Creating our application + +Now let's add our new Go code. + +Add the following struct declarations to `app.go` before the function definitions: + +```go +type RandomImage struct { + Message string + Status string +} + +type AllBreeds struct { + Message map[string]map[string][]string + Status string +} + +type ImagesByBreed struct { + Message []string + Status string +} +``` + +Add the following functions to `app.go` (perhaps after the existing function definitions): + +```go +func (a *App) GetRandomImageUrl() string { + response, err := http.Get("https://dog.ceo/api/breeds/image/random") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data RandomImage + json.Unmarshal(responseData, &data) + + return data.Message +} + +func (a *App) GetBreedList() []string { + var breeds []string + + response, err := http.Get("https://dog.ceo/api/breeds/list/all") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data AllBreeds + json.Unmarshal(responseData, &data) + + for k := range data.Message { + breeds = append(breeds, k) + } + + sort.Strings(breeds) + + return breeds +} + +func (a *App) GetImageUrlsByBreed(breed string) []string { + + url := fmt.Sprintf("%s%s%s%s", "https://dog.ceo/api/", "breed/", breed, "/images") + response, err := http.Get(url) + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data ImagesByBreed + json.Unmarshal(responseData, &data) + + return data.Message +} +``` + +Modify the `import` section of `app.go` to look like this: + +```go +import ( + "context" + "fmt" + "encoding/json" + "io/ioutil" + "log" + "net/http" + "sort" +) +``` + +Add the following lines to `frontend/src/App.svelte`: + + +```html + + +

Dogs API

+
+ + Click on down arrow to select a breed + + +
+
+{#if showRandomPhoto} + No dog found +{/if} +{#if showBreedPhotos} + {#each photos as photo} + No dog found + {/each} +{/if} + + +``` + + +### Testing the application + +To generate the bindings and test the application, run `wails dev`. + +### Compiling the application + +To compile the application to a single, production grade binary, run `wails build`. 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 new file mode 100644 index 00000000..b783461d --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -0,0 +1,122 @@ +--- +sidebar_position: 10 +--- + +# Hello World + +The aim of this tutorial is to get you up and running with the most basic application using Wails. You will be able to: + +- Create a new Wails application +- Build the application +- Run the application + +:::note + +This tutorial uses Windows as the target platform. Output will vary slightly depending on your operating system. + +::: + +## Create a new Wails application + +To create a new Wails application using the default vanilla JS template, you need to run the following command: + +```bash +wails init -n helloworld +``` + +You should see something similar to the following: + +``` +Wails CLI v2.0.0 + +Initialising Project 'helloworld' +--------------------------------- + +Project Name: helloworld +Project Directory: C:\Users\leaan\tutorial\helloworld +Project Template: vanilla +Template Support: https://wails.io + +Initialised project 'helloworld' in 232ms. +``` + +This will create a new directory called `helloworld` in the current directory. In this directory, you will find a number of files: + +``` +build/ - Contains the build files + compiled application +frontend/ - Contains the frontend files +app.go - Contains the application code +main.go - The main program with the application configuration +wails.json - The project configuration file +go.mod - The go module file +go.sum - The go module checksum file +``` + +## Build the application + +To build the application, change to the new `helloworld` project directory and run the following command: + +```bash +wails build +``` + +You should see something like the following: + +``` +Wails CLI v2.0.0 + +App Type: desktop +Platforms: windows/amd64 +Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe +Build Mode: Production +Skip Frontend: false +Compress: false +Package: true +Clean Build Dir: false +LDFlags: "" +Tags: [] +Race Detector: false + +Building target: windows/amd64 +------------------------------ + - Installing frontend dependencies: Done. + - Compiling frontend: Done. + - Generating bundle assets: Done. + - Compiling application: Done. +Built 'C:\Users\leaan\tutorial\helloworld\build\bin\helloworld.exe' in 10.616s. +``` + +This has compiled the application and saved it in the `build/bin` directory. + +## Run the application + +If we view the `build/bin` directory in Windows Explorer, we should see our project binary: + +```mdx-code-block +
+ +
+
+``` + +We can run it by simply double-clicking the `helloworld.exe` file. + +On Mac, Wails generates a `helloworld.app` file which can be run by double-clicking it. + +On Linux, you can run the application using `./helloworld` from the `build/bin` directory. + +You should see the application working as expected: + +```mdx-code-block +
+ +
+
+``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json index 49cf4687..a589cd40 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json +++ b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json @@ -4,19 +4,19 @@ "description": "The label for version v2.0.0-rc.1" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "시작하기", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "참조", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { - "message": "Runtime", + "message": "런타임", "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "커뮤니티", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { @@ -24,15 +24,15 @@ "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "가이드", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "튜토리얼", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "기여", "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-docs/version-v2.0.0.json b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0.json index 421c838e..cb58bc57 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0.json +++ b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.0.0.json @@ -4,19 +4,19 @@ "description": "The label for version v2.0.0" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "시작하기", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "참조", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { - "message": "Runtime", + "message": "런타임", "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "커뮤니티", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { @@ -24,15 +24,15 @@ "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "가이드", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "튜토리얼", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "기여", "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-docs/version-v2.1.0.json b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.1.0.json index f29e6b24..0f237faf 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.1.0.json +++ b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.1.0.json @@ -4,19 +4,19 @@ "description": "The label for version v2.1.0" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "시작하기", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "참조", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { - "message": "Runtime", + "message": "런타임", "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "커뮤니티", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { @@ -24,15 +24,15 @@ "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "가이드", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "튜토리얼", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "기여", "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-docs/version-v2.2.0.json b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.2.0.json new file mode 100644 index 00000000..130804ee --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-docs/version-v2.2.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.2.0", + "description": "The label for version v2.2.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "시작하기", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "참조", + "description": "The label for category Reference in sidebar docs" + }, + "sidebar.docs.category.Runtime": { + "message": "런타임", + "description": "The label for category Runtime in sidebar docs" + }, + "sidebar.docs.category.Community": { + "message": "커뮤니티", + "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": "가이드", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "튜토리얼", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "기여", + "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 new file mode 100644 index 00000000..6cfefcb7 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/changelog.mdx @@ -0,0 +1,570 @@ +# 변경 로그 + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +## [Unreleased] + +### Added +- Added `OpenInspectorOnStartup` to debug options to allow opening the WebInspector during startup of the application in debug mode. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2080) +- On macOS `wails doctor` now also shows the version of Xcode installed. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2089) +- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091) + +### Fixed +- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081) +- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103) + +## v2.2.0 - 2022-11-09 + +### Added + +- Wails now uses a purpose built, native Go implementation of Microsoft's webview2loader dll. This means there is no need to embed the `Webview2Loader.dll` file in your binaries, meaning filesizes will be ~130k smaller! Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/1974)! +- This release provides much more control over custom asset handling via the new [AssetServer](https://wails.io/docs/reference/options#assetserver) options. This allows you to provide your own custom asset handler and hook into the request chain through middleware. Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/2016) and @mholt for the [initial idea](https://github.com/wailsapp/wails/issues/2007) and extensive testing. +- It is now possible to customise the layout of your Wails projects using 2 new options in `wails.json`: + - `build:dir` can be used to specify where the build files reside + - `frontend:dir` can be used to specify where the frontend files reside + - If `go.mod` is not found in the same directory as `wails.json`, the cli will look up the parent directories to find it. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2009) +- Colour output in the CLI can now be turned off by using the `--nocolor` flag. This is useful for CI/CD pipelines. Thanks to @scottopell for the [PR](https://github.com/wailsapp/wails/pull/1947) +- A JSON schema definition for the `wails.json` file has been added. IDEs should now provide code complete when editing `wails.json`. Thanks to @binyamin for the [PR](https://github.com/wailsapp/wails/pull/1864) +- The `EventsOn*` methods now return a function that can be called to deregister the listener. Thanks to @joshbuddy for the [PR](https://github.com/wailsapp/wails/pull/1969) + +### Fixed + +- Webview2 on Windows returns a potential whitespace when defining the style like this style="--wails-draggable: drag". Fixed by @stffabi in https://github.com/wailsapp/wails/pull/1989 +- Bound structs that had `struct{}` field types would cause the Typescript generation to fail. Thanks to @ParkourLiu for the [PR](https://github.com/wailsapp/wails/pull/1999) +- When maximising a frameless window on Windows with multiple monitors, the window could sometimes become blank. Thanks to @stffabi for the [fix](https://github.com/wailsapp/wails/pull/2043) + +### Changed + +- The troubleshooting guide was updated to provide guidance when [Vite fails to start](https://wails.io/docs/guides/troubleshooting#cannot-start-service-host-version-xxx-does-not-match-binary-version-xxx). Thanks to @willdot for the [PR](https://github.com/wailsapp/wails/pull/2000). +- English, Chinese and Japanese documentation updates. Thanks to @misitebao. + +### Deprecated + +- The [AssetsHandler](https://wails.io/docs/reference/options#assetshandler) option has been deprecated. Please use the [AssetServer](https://wails.io/docs/reference/options#assetserver) option instead. + +### New Contributors + +- @willdot made their first contribution in https://github.com/wailsapp/wails/pull/2000 +- @ParkourLiu made their first contribution in https://github.com/wailsapp/wails/pull/1999 +- @binyamin made their first contribution in https://github.com/wailsapp/wails/pull/1864 +- @joshbuddy made their first contribution in https://github.com/wailsapp/wails/pull/1969 +- @sgosiaco made their first contribution in https://github.com/wailsapp/wails/pull/2062 + +## v2.1.0 - 2022-10-18 + +### Removed + +- The `RGBA` option in `options.App` has now been removed. Use `BackgroundColour` instead. + +### Added + +- [Support for defaulting to No button in Windows dialogs](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony in https://github.com/wailsapp/wails/pull/1875 +- Add missing resize for frameless window on Linux - @Lyimmi in https://github.com/wailsapp/wails/pull/1918 +- [Add window transparency for linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi in https://github.com/wailsapp/wails/pull/1926 +- [Add WindowExecJS method](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony in https://github.com/wailsapp/wails/pull/1927 +- [Add support for `Info.dev.plist` on macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony in https://github.com/wailsapp/wails/pull/1960 +- [Add ZoomFactor get/set and add the respective windows only options](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye in https://github.com/wailsapp/wails/pull/1463 + +### Fixed + +- Embed directories auto-created if they don't exist - @leaanthony in https://github.com/wailsapp/wails/pull/1983 +- Quote command arguments if they have a space - @leaanthony in https://github.com/wailsapp/wails/pull/1892 +- Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916 +- Fix gtk_window_begin_resize_drag's mouse button - @Lyimmi in https://github.com/wailsapp/wails/pull/1920 +- Fix binding generation special cases - @JulioDRF in https://github.com/wailsapp/wails/pull/1902 +- Remove the `.git` directory in the template - @misitebao in https://github.com/wailsapp/wails/pull/1929 +- Fix wails dev - @JulioDRF in https://github.com/wailsapp/wails/pull/1931 +- Fix for considering new `go` files in dev filesystem watcher - @scottopell in https://github.com/wailsapp/wails/pull/1946 +- Prevent type parsing to interfere with Typescript package name - @ValentinTrinque in https://github.com/wailsapp/wails/pull/1942 +- [dev] Do not try to infer assetdir from fs.FS when a frontend dev server is in use - @stffabi in https://github.com/wailsapp/wails/pull/1972 +- Fix init command not listed in wails help message - @lyon-lee-dev in https://github.com/wailsapp/wails/pull/1976 + +### Changed + +- Add PR checks - @leaanthony in https://github.com/wailsapp/wails/pull/1879 +- Auto label project cards - @leaanthony in https://github.com/wailsapp/wails/pull/1881 +- Add issue translator - @leaanthony in https://github.com/wailsapp/wails/pull/1891 +- Update label names in the issue template - @misitebao in https://github.com/wailsapp/wails/pull/1893 +- obfuscated instead of obfuscate in the docs - @arifali123 in https://github.com/wailsapp/wails/pull/1895 +- [assetHandler] Remove redundant log prefix - @stffabi in https://github.com/wailsapp/wails/pull/1896 +- [dev] Do not generate bindings in the dev app itself - @stffabi in https://github.com/wailsapp/wails/pull/1899 +- Update Chinese translation - @almas1992 in https://github.com/wailsapp/wails/pull/1894 +- Refactor app - @leaanthony in https://github.com/wailsapp/wails/pull/1909 +- Update documents - @misitebao in https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936 +- Adding Tutorial link - @raguay in https://github.com/wailsapp/wails/pull/1903 +- Add react-ts-vite-tailwind template - @hotafrika in https://github.com/wailsapp/wails/pull/1930 +- Update README.zh-Hans.md - @o8x in https://github.com/wailsapp/wails/pull/1949 +- Add Elm Tailwind CSS community template - @rnice01 in https://github.com/wailsapp/wails/pull/1939 +- Chore/generate sponsors - @leaanthony in https://github.com/wailsapp/wails/pull/1965 +- Use swc + pnpm for website - @leaanthony in https://github.com/wailsapp/wails/pull/1966 +- Sort structs in models.ts - @leaanthony in https://github.com/wailsapp/wails/pull/1961 +- Update Sponsor Image - @github-actions in https://github.com/wailsapp/wails/pull/1973 +- docs: sync documents - @misitebao in https://github.com/wailsapp/wails/pull/1968 +- Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979 + +### New Contributors + +- @arifali123 made their first contribution in https://github.com/wailsapp/wails/pull/1895 +- @almas1992 made their first contribution in https://github.com/wailsapp/wails/pull/1894 +- @JulioDRF made their first contribution in https://github.com/wailsapp/wails/pull/1902 +- @hotafrika made their first contribution in https://github.com/wailsapp/wails/pull/1930 +- @scottopell made their first contribution in https://github.com/wailsapp/wails/pull/1946 +- @o8x made their first contribution in https://github.com/wailsapp/wails/pull/1949 +- @rnice01 made their first contribution in https://github.com/wailsapp/wails/pull/1939 +- @cuigege made their first contribution in https://github.com/wailsapp/wails/pull/1979 +- @lyon-lee-dev made their first contribution in https://github.com/wailsapp/wails/pull/1976 + +## v2.0.0 - 2022-09-22 + +### Fixed + +- Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858 +- Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862 + +### Changed + +- Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854 +- Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853 +- chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848 +- Update introduction.mdx by @ParvinEyvazov in https://github.com/wailsapp/wails/pull/1863 +- Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869 +- Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849 + +### New Contributors + +- @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863 + +## v2.0.0-rc.1 - 2022-09-13 + +### Deprecated + +- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command. + +### Added + +- Add garble support by @leaanthony in https://github.com/wailsapp/wails/pull/1793 +- Make draggable CSS property customisable by @leaanthony in https://github.com/wailsapp/wails/pull/1828 +- Add Some WindowState by @zandercodes in https://github.com/wailsapp/wails/pull/1349 +- Make EventsOff capable of removing multiple listeners by @Lyimmi in https://github.com/wailsapp/wails/pull/1822 + +### Fixed + +- Use `Promise` when Go routine does not output by @SheetJSDev in https://github.com/wailsapp/wails/pull/1821 +- preact-ts template build fix by @Debdut in https://github.com/wailsapp/wails/pull/1781 +- fix frontend/tsconfig.js by @Lyimmi in https://github.com/wailsapp/wails/pull/1795 +- fix: fix bugs in website by @misitebao in https://github.com/wailsapp/wails/pull/1810 +- Fix vue-ts template by @leaanthony in https://github.com/wailsapp/wails/pull/1813 +- Remove duplicate defs in win32/window.go by @AlbinoDrought in https://github.com/wailsapp/wails/pull/1832 + +### Changed + +- Upgrade React to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1744 +- Upgrade Lit to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1745 +- Support vite3 for Vue by @leaanthony in https://github.com/wailsapp/wails/pull/1746 +- Preact templates for vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1770 +- Prevent env variables and registry overrides from changing behaviour by @stffabi in https://github.com/wailsapp/wails/pull/1771 +- Use go implementation to retrieve the version of a fixed runtime by @stffabi in https://github.com/wailsapp/wails/pull/1790 +- Change contribution guide type from "doc" to "page" by @misitebao in https://github.com/wailsapp/wails/pull/1777 +- feat(website): repair document content by @misitebao in https://github.com/wailsapp/wails/pull/1775 +- chore: sort out files by @misitebao in https://github.com/wailsapp/wails/pull/1776 +- Add Korean to doc by @jaesung9507 in https://github.com/wailsapp/wails/pull/1774 +- Add README.ja.md by @shinshin86 in https://github.com/wailsapp/wails/pull/1783 +- Reorganized contribution guidelines page by @misitebao in https://github.com/wailsapp/wails/pull/1784 +- fix(website): fix link by @misitebao in https://github.com/wailsapp/wails/pull/1785 +- Update templates.mdx by @KiddoV in https://github.com/wailsapp/wails/pull/1799 +- Better watcher by @leaanthony in https://github.com/wailsapp/wails/pull/1827 +- Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" by @prurigro in https://github.com/wailsapp/wails/pull/1811 +- Optimize images by @imgbot in https://github.com/wailsapp/wails/pull/1812 + +### New Contributors + +- @shinshin86 made their first contribution in https://github.com/wailsapp/wails/pull/1783 +- @Debdut made their first contribution in https://github.com/wailsapp/wails/pull/1781 +- @KiddoV made their first contribution in https://github.com/wailsapp/wails/pull/1799 +- @zandercodes made their first contribution in https://github.com/wailsapp/wails/pull/1349 +- @prurigro made their first contribution in https://github.com/wailsapp/wails/pull/1811 +- @SheetJSDev made their first contribution in https://github.com/wailsapp/wails/pull/1821 +- @AlbinoDrought made their first contribution in https://github.com/wailsapp/wails/pull/1832 +- @imgbot made their first contribution in https://github.com/wailsapp/wails/pull/1812 + +## v2.0.0-beta.44 - 2022-08-20 + +### Deprecated + +The `data-wails-drag` attribute is being deprecated in favour of the following CSS style: `style="--wails-draggable:drag"`. You can use `style="--wails-draggable:no-drag"` to disable the drag behaviour. For this release only, you can test this by setting the following application option: + +```go +Experimental: &options.Experimental{ + UseCSSDrag: true, +}, +``` + +### Added + +- Set file permissions for generated files by @leaanthony in https://github.com/wailsapp/wails/pull/1763 +- Experimental support for CSS Drag detection by @leaanthony in https://github.com/wailsapp/wails/pull/1750 + +### Fixed + +- Bug fix collecting of output binaries for platforms by @stffabi in https://github.com/wailsapp/wails/pull/1715 +- Fix registration of exposed fields by @ValentinTrinque in https://github.com/wailsapp/wails/pull/1727 +- Fix column widths for doctor command's dependencies table by @ianmjones in https://github.com/wailsapp/wails/pull/1717 +- Do not generate bindings for `OnBeforeClose` method + +### Changed + +- Misc code refactors and removal by @leaanthony in https://github.com/wailsapp/wails/pull/1713 +- Add react-router to routing.mdx by @Maicarons2022 in https://github.com/wailsapp/wails/pull/1755 +- Add Japanese to doc by @RyoTagami in https://github.com/wailsapp/wails/pull/1716 +- Added EmailIt and Modal File Manager by @raguay in https://github.com/wailsapp/wails/pull/1728 +- Adding my ScriptBar program by @raguay in https://github.com/wailsapp/wails/pull/1761 +- Link to general webview2 runtime download page and not to a specific language by @stffabi in https://github.com/wailsapp/wails/pull/1764 +- Updated translations in https://github.com/wailsapp/wails/pull/1719 and https://github.com/wailsapp/wails/pull/1720 +- Remove text outside style's brackets by @DragoSpiro98 in https://github.com/wailsapp/wails/pull/1765 + +### New Contributors + +- @RyoTagami made their first contribution in https://github.com/wailsapp/wails/pull/1716 +- @raguay made their first contribution in https://github.com/wailsapp/wails/pull/1728 +- @Maicarons2022 made their first contribution in https://github.com/wailsapp/wails/pull/1755 +- @DragoSpiro98 made their first contribution in https://github.com/wailsapp/wails/pull/1765 + +## v2.0.0-beta.43 - 2022-08-08 + +### Added + +- Add support for retrieving the release notes from Github by @leaanthony in https://github.com/wailsapp/wails/pull/1679 +- Add `frontend:dev:install` configuration by @LGiki in https://github.com/wailsapp/wails/pull/1666 + +### Fixed + +- Fix formatting of some error messages by @stffabi in https://github.com/wailsapp/wails/pull/1665 +- Windows dialogs now work when window is not visible yet by @leaanthony in https://github.com/wailsapp/wails/pull/1662 +- Multiple fixes for MacOS asset requests by @stffabi in https://github.com/wailsapp/wails/pull/1668 and https://github.com/wailsapp/wails/pull/1681 +- Fix for Go 1.19 by @stffabi in https://github.com/wailsapp/wails/pull/1689 +- Removed Linux warnings by @leaanthony in https://github.com/wailsapp/wails/pull/1656 +- Better support for doubleclick events in drag regions by @leaanthony in https://github.com/wailsapp/wails/pull/1704 +- Allow MacOS frameless window to be miniturisable by @leaanthony in https://github.com/wailsapp/wails/pull/1705 + +### Changed + +- add wails-sveltekit-template by @h8gi in https://github.com/wailsapp/wails/pull/1671 +- wails doctor now reports correct MacOS os id by @stffabi in https://github.com/wailsapp/wails/pull/1673 +- Update application-development.mdx by @SamHennessy in https://github.com/wailsapp/wails/pull/1682 +- Move SetMin/Max calls to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1684 +- Change `frontend:dev` to `frontend:dev:build` by @LGiki in https://github.com/wailsapp/wails/pull/1691 +- Build frontend only before starting the dev watcher command by @stffabi in https://github.com/wailsapp/wails/pull/1694 +- Improve error message for auto dev server discovery without a dev watcher by @stffabi in https://github.com/wailsapp/wails/pull/1711 + +### New Contributors + +- @h8gi made their first contribution in https://github.com/wailsapp/wails/pull/1671 +- @SamHennessy made their first contribution in https://github.com/wailsapp/wails/pull/1682 + +## v2.0.0-beta.42 - 2022-07-25 + +### Added + +- Added `options.NewRGBA` and `options.NewRGB` functions to create `*options.RGBA` by @leaanthony + +### Fixed + +- Fixed initial build of frontend when using `wails dev` on new projects by @leaanthony in https://github.com/wailsapp/wails/pull/1650 +- Ignore empty install command when running `wails dev` by @stffabi in https://github.com/wailsapp/wails/pull/1651 +- Fixed error reporting in templates +- BackgroundColour documentation fix +- Generalize manual compile steps [Documentation] by @acheong08 in https://github.com/wailsapp/wails/pull/1644 + +## v2.0.0-beta.40 - 2022-07-24 + +### Added + +- Add Show() and Hide() to runtime to show/hide application by @leaanthony in https://github.com/wailsapp/wails/pull/1599 +- Override target platform/arch using GOOS and GOARCH environment variables by @leaanthony in https://github.com/wailsapp/wails/pull/1618 +- Add option to skip frontend rebuild in dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1632 + +### Fixed + +- Update svelte templates to use vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1643 +- Fix plain template by @stffabi in https://github.com/wailsapp/wails/pull/1609 +- Fix Website layout by @leaanthony in https://github.com/wailsapp/wails/pull/1616 +- Fixed typo in documentation page docs/howdoesitwork by @MyNameIsAres in https://github.com/wailsapp/wails/pull/1636 +- Use scaling when setting min/max window by @leaanthony in https://github.com/wailsapp/wails/pull/1557 + +### Changed + +- Install dev dependencies before starting dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1615 +- Translate and fix website text by @misitebao in https://github.com/wailsapp/wails/pull/1525 +- docs: add MyNameIsAres as a contributor for doc by @allcontributors in https://github.com/wailsapp/wails/pull/1638 +- Deprecate Fullscreen appoption by @acheong08 in https://github.com/wailsapp/wails/pull/1640 + +### Deprecated + +- The `Fullscreen` application option is deprecated. Please use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) instead. + +### New Contributors + +- @MyNameIsAres made their first contribution in https://github.com/wailsapp/wails/pull/1636 + +## v2.0.0-beta.39.2 - 2022-07-20 + +### Added + +- Update example for macOS Menu by @acheong08 in https://github.com/wailsapp/wails/pull/1600 + +### Fixed + +- Reinstate Go 1.17 compatibility by @leaanthony in https://github.com/wailsapp/wails/pull/1605 + +## v2.0.0-beta.39 - 2022-07-19 + +### Added + +- New screen dimensions runtime API by @skamensky in https://github.com/wailsapp/wails/pull/1519 +- Auto discover vite devserver port by @leaanthony in https://github.com/wailsapp/wails/pull/1547 +- Add nixpkgs support to doctor command. by @ianmjones in https://github.com/wailsapp/wails/pull/1551 +- New pre-build hooks feature by @leaanthony in https://github.com/wailsapp/wails/pull/1578 +- New production log level option by @leaanthony in https://github.com/wailsapp/wails/pull/1555 + +### Fixed + +- Fix stack corruption in Windows when using ICoreWebView2HttpHeadersCollectionIterator by @stffabi in https://github.com/wailsapp/wails/pull/1589 +- Move WindowGet\* to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1464 +- Allow -appargs flag to pass flags to binary. by @ianmjones in https://github.com/wailsapp/wails/pull/1534 +- Fix checking for installed apt package in none English session. by @ianmjones in https://github.com/wailsapp/wails/pull/1548 +- Fix OnBeforeClose code for Mac by @leaanthony in https://github.com/wailsapp/wails/pull/1558 +- Support Maps in TS conversion by @leaanthony in https://github.com/wailsapp/wails/pull/1435 +- Check for line length when scanning for local devserver url by @leaanthony in https://github.com/wailsapp/wails/pull/1566 +- Remove usage of unsafe.Pointer in winc by @stffabi and @leaanthony in https://github.com/wailsapp/wails/pull/1556 + +### Changed + +- Rename WindowSetRGBA -> WindowSetBackgroundColour by @leaanthony in https://github.com/wailsapp/wails/pull/1506 +- Improvements to the dev command by @stffabi in https://github.com/wailsapp/wails/pull/1510 +- Update vscode template by @leaanthony in https://github.com/wailsapp/wails/pull/1398 +- Bump svelte from 3.42.2 to 3.49.0 in /v2/internal/frontend/runtime/dev by @dependabot in https://github.com/wailsapp/wails/pull/1572 +- Bump svelte from 3.42.5 to 3.49.0 in /v2/internal/frontend/runtime by @dependabot in https://github.com/wailsapp/wails/pull/1573 +- Add troubleshooting for `Not Found` error by @acheong08 in https://github.com/wailsapp/wails/pull/1586 +- Docs/better homepage by @leaanthony in https://github.com/wailsapp/wails/pull/1591 + +### New Contributors + +- @skamensky made their first contribution in https://github.com/wailsapp/wails/pull/1519 +- @acheong08 made their first contribution in https://github.com/wailsapp/wails/pull/1586 + +**Full Changelog**: https://github.com/wailsapp/wails/compare/v2.0.0-beta.38...v2.0.0-beta.39 + +## v2.0.0-beta.38 - 2022-06-27 + +### Added + +- Add race detector to build & dev by @Lyimmi in https://github.com/wailsapp/wails/pull/1426 +- [linux] Support `linux/arm` architecture by @Lyimmi in https://github.com/wailsapp/wails/pull/1427 +- Create gitignore when using `-g` option by @jaesung9507 in https://github.com/wailsapp/wails/pull/1430 +- [windows] Add Suspend/Resume callback support by @leaanthony in https://github.com/wailsapp/wails/pull/1474 +- Add runtime function `WindowSetAlwaysOnTop` by @chenxiao1990 in https://github.com/wailsapp/wails/pull/1442 +- [windows] Allow setting browser path by @NanoNik in https://github.com/wailsapp/wails/pull/1448 + +### Fixed + +- [linux] Improve switching to main thread for callbacks by @stffabi in https://github.com/wailsapp/wails/pull/1392 +- [windows] Fix WebView2 minimum runtime version check by @stffabi in https://github.com/wailsapp/wails/pull/1456 +- [linux] Fix apt command syntax (#1458) by @abtin in https://github.com/wailsapp/wails/pull/1461 +- [windows] Set Window Background colour if provided + debounce redraw option by @leaanthony in https://github.com/wailsapp/wails/pull/1466 +- Fix small typo in docs by @LukenSkyne in https://github.com/wailsapp/wails/pull/1449 +- Fix the url to surge by @andywenk in https://github.com/wailsapp/wails/pull/1460 +- Fixed theme change at runtime by @leaanthony in https://github.com/wailsapp/wails/pull/1473 +- Fix: Don't stop if unable to remove temporary bindings build by @leaanthony in https://github.com/wailsapp/wails/pull/1465 +- [windows] Pass the correct installationStatus to the webview installation strategy by @stffabi in https://github.com/wailsapp/wails/pull/1483 +- [windows] Make `SetBackgroundColour` compatible for `windows/386` by @stffabi in https://github.com/wailsapp/wails/pull/1493 +- Fix lit-ts template by @Orijhins in https://github.com/wailsapp/wails/pull/1494 + +### Changed + +- [windows] Load WebView2 loader from embedded only by @stffabi in https://github.com/wailsapp/wails/pull/1432 +- Add showcase entry for October + update homepage carousel entry for October by @marcus-crane in https://github.com/wailsapp/wails/pull/1436 +- Always use return in wrapped method by @leaanthony in https://github.com/wailsapp/wails/pull/1410 +- [windows] Unlock OSThread after native calls have been finished by @stffabi in https://github.com/wailsapp/wails/pull/1441 +- Add `BackgroundColour` and deprecate `RGBA` by @leaanthony in https://github.com/wailsapp/wails/pull/1475 +- AssetsHandler remove retry logic in dev mode by @stffabi in https://github.com/wailsapp/wails/pull/1479 +- Add Solid JS template to docs by @sidwebworks in https://github.com/wailsapp/wails/pull/1492 +- Better signal handling by @leaanthony in https://github.com/wailsapp/wails/pull/1488 +- Chore/react 18 create root by @tomanagle in https://github.com/wailsapp/wails/pull/1489 + +### New Contributors + +- @jaesung9507 made their first contribution in https://github.com/wailsapp/wails/pull/1430 +- @LukenSkyne made their first contribution in https://github.com/wailsapp/wails/pull/1449 +- @andywenk made their first contribution in https://github.com/wailsapp/wails/pull/1460 +- @abtin made their first contribution in https://github.com/wailsapp/wails/pull/1461 +- @chenxiao1990 made their first contribution in https://github.com/wailsapp/wails/pull/1442 +- @NanoNik made their first contribution in https://github.com/wailsapp/wails/pull/1448 +- @sidwebworks made their first contribution in https://github.com/wailsapp/wails/pull/1492 +- @tomanagle made their first contribution in https://github.com/wailsapp/wails/pull/1489 + +## v2.0.0-beta.37 - 2022-05-26 + +### Added + +- Add `nogen` flag in wails dev command by @mondy in https://github.com/wailsapp/wails/pull/1413 +- Initial support for new native translucency in Windows Preview by @leaanthony in https://github.com/wailsapp/wails/pull/1400 + +### Fixed + +- Bugfix/incorrect bindings by @leaanthony in https://github.com/wailsapp/wails/pull/1383 +- Fix runtime.js events by @polikow in https://github.com/wailsapp/wails/pull/1369 +- Fix docs formatting by @antimatter96 in https://github.com/wailsapp/wails/pull/1372 +- Events | fixes #1388 by @lambdajack in https://github.com/wailsapp/wails/pull/1390 +- bugfix: correct typo by @tmclane in https://github.com/wailsapp/wails/pull/1391 +- Fix typo in docs by @LGiki in https://github.com/wailsapp/wails/pull/1393 +- Fix typo bindings.js to ipc.js by @rayshoo in https://github.com/wailsapp/wails/pull/1406 +- Make sure to execute the menu callbacks on a new goroutine by @stffabi in https://github.com/wailsapp/wails/pull/1403 +- Update runtime.d.ts & templates by @Yz4230 in https://github.com/wailsapp/wails/pull/1421 +- Add missing className to input in React and Preact templates by @edwardbrowncross in https://github.com/wailsapp/wails/pull/1419 + +### Changed + +- Improve multi-platform builds by @stffabi in https://github.com/wailsapp/wails/pull/1373 +- During wails dev only use reload logic if no AssetsHandler are in use by @stffabi in https://github.com/wailsapp/wails/pull/1385 +- Update events.mdx by @Junkher in https://github.com/wailsapp/wails/pull/1387 +- Add Next.js template by @LGiki in https://github.com/wailsapp/wails/pull/1394 +- Add docs on wails generate module by @TechplexEngineer in https://github.com/wailsapp/wails/pull/1414 +- Add macos custom menu EditMenu tips by @daodao97 in https://github.com/wailsapp/wails/pull/1423 + +### New Contributors + +- @polikow made their first contribution in https://github.com/wailsapp/wails/pull/1369 +- @antimatter96 made their first contribution in https://github.com/wailsapp/wails/pull/1372 +- @Junkher made their first contribution in https://github.com/wailsapp/wails/pull/1387 +- @lambdajack made their first contribution in https://github.com/wailsapp/wails/pull/1390 +- @LGiki made their first contribution in https://github.com/wailsapp/wails/pull/1393 +- @rayshoo made their first contribution in https://github.com/wailsapp/wails/pull/1406 +- @TechplexEngineer made their first contribution in https://github.com/wailsapp/wails/pull/1414 +- @mondy made their first contribution in https://github.com/wailsapp/wails/pull/1413 +- @Yz4230 made their first contribution in https://github.com/wailsapp/wails/pull/1421 +- @daodao97 made their first contribution in https://github.com/wailsapp/wails/pull/1423 +- @edwardbrowncross made their first contribution in https://github.com/wailsapp/wails/pull/1419 + +## v2.0.0-beta.36 - 2022-04-27 + +### Fixed + +- [v2] Validate devServer property to be of the correct form by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1359 +- [v2, darwin] Initialize native variables on stack to prevent segfault by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1362 +- Vue-TS template fix + +### Changed + +- Added `OnStartup` method back to default templates + +## v2.0.0-beta.35 - 2022-04-27 + +### Breaking Changes + +- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324) +- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) + +### Added + +- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info. +- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`! +- Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi) +- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows. +- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript) +- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi) +- Added docs for [code-signing](https://wails.io/docs/guides/signing) and [NSIS installer](https://wails.io/docs/guides/windows-installer) - [@gardc](https://github.com/gardc) +- Add support for `-trimpath` [build flag](https://wails.io/docs/reference/cli#build) +- Add support for a default AssetsHandler - [@stffabi](https://github.com/stffabi) + +### Fixed + +- Improved mimetype detection for BOM marker and comments - [@napalu](https://github.com/napalu) +- Remove duplicate mimetype entries - [@napalu](https://github.com/napalu) +- Remove duplicate Typescript imports in generated definition files - [@adalessa](https://github.com/adalessa) +- Add missing method declaration - [@adalessa](https://github.com/adalessa) +- Fix Linux sigabrt on start - [@napalu](https://github.com/napalu) +- Double Click event now works on elements with `data-wails-drag` attribute - [@jicg](https://github.com/jicg) +- Suppress resizing during minimize of a frameless window - [@stffabi](https://github.com/stffabi) +- Fixed TS/JS generation for Go methods with no returns +- Fixed WailsJS being generated in project directory + +### Changed + +- Website docs are now versioned +- Improved `runtime.Environment` call +- Improve the close action for Mac +- A bunch of dependabot security updates +- Improved website content - [@misitebao](https://github.com/misitebao) +- Upgrade issue template - [@misitebao](https://github.com/misitebao) +- Convert documents that don't require version management to individual pages + - [@misitebao](https://github.com/misitebao) +- Website now using Algolia search + +## v2.0.0-beta.34 - 2022-03-26 + +### Added + +- Add support for 'DomReady' callback on linux by [@napalu](https://github.com/napalu) in #1249 +- MacOS - Show extension by default by [@leaanthony](https://github.com/leaanthony) in #1228 + +### Fixed + +- [v2, nsis] Seems like / as path separator works only for some directives in a cross platform way by [@stffabi](https://github.com/stffabi) in #1227 +- import models on binding definition by [@adalessa](https://github.com/adalessa) in #123 + + 1 + +- Use local search on website by [@leaanthony](https://github.com/leaanthony) in #1234 +- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240 +- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241 +- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243 +- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245 +- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230 +- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247 +- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258 +- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255 +- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257 +- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212 +- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180 + +### Changed + +- feat(website): sync documents and add content by [@misitebao](https://github.com/misitebao) in #1215 +- refactor(cli): optimize default templates by [@misitebao](https://github.com/misitebao) in #1214 +- Run watcher after initial build by [@leaanthony](https://github.com/leaanthony) in #1216 +- Feature/docs update by [@leaanthony](https://github.com/leaanthony) in #1218 +- feat(website): optimize website and sync documents by [@misitebao](https://github.com/misitebao) in #1219 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1224 +- Default index page by [@leaanthony](https://github.com/leaanthony) in #1229 +- Build added win32 compatibility by [@fengweiqiang](https://github.com/fengweiqiang) in #1238 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1260 + +## v2.0.0-beta.33 - 2022-03-05 + +### Added + +- NSIS Installer support for creating installers for Windows applications - Thanks [@stffabi](https://github.com/stffabi) 🎉 +- New frontend:dev:watcher command to spin out 3rd party watchers when using wails dev - Thanks [@stffabi](https://github.com/stffabi)🎉 +- Remote templates now support version tags - Thanks [@misitebao](https://github.com/misitebao) 🎉 + +### Fixed + +- A number of fixes for ARM Linux providing a huge improvement - Thanks [@ianmjones](https://github.com/ianmjones) 🎉 +- Fixed potential Nil reference when discovering the path to `index.html` +- Fixed crash when using `runtime.Log` methods in a production build +- Improvements to internal file handling meaning webworkers will now work on Windows - Thanks [@stffabi](https://github.com/stffabi)🎉 + +### Changed + +- The Webview2 bootstrapper is now run as a normal user and doesn't require admin rights +- The docs have been improved and updated +- Added troubleshooting guide diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/coc.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/coc.mdx new file mode 100644 index 00000000..a027c627 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/coc.mdx @@ -0,0 +1,83 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at coc@wails.io. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][mozilla coc]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][faq]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/community-guide.mdx new file mode 100644 index 00000000..a6bf1812 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/community-guide.mdx @@ -0,0 +1,141 @@ +# 커뮤니티 가이드 + +The number of Wails users is growing at an incredible rate, and if you're reading this, chances are you're ready to join. So... welcome! + +## Resources + +### Code of Conduct + +This [Code of Conduct](./coc) is an easy guide to develop the technical communities in which we participate. + +### Stay in the Know + +- Follow our [official Twitter account](https://twitter.com/wailsapp). + +### Get Support + +- [GitHub](https://github.com/wailsapp/wails) - If you have a bug to report or feature to request, that's what the GitHub issues are for. Please respect the rules specified in each repository's issue template. +- [Slack](https://gophers.slack.com/messages/CJ4P9F7MZ/) - A place for Wails devs to meet and chat in real time. +- [QQ Group(中文)](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - A Wails group for Chinese developers to communicate, where you can get help from other developers. + +### Explore the Ecosystem + +- [The Awesome Wails Page](https://github.com/wailsapp/awesome-wails) - See what other awesome resources have been published by other awesome people. + +## Ways of contributing + +Wails is an open source, community driven project. We welcome anyone to join us in contributing to the project. This documentation is aimed at anyone wishing to get familiar with the project and the development processes. + +There are many ways to contribute to the project: + +- Developing new features +- Fixing bugs +- Testing +- Documenting features +- Writing tutorials / guides +- Helping others on the issues + discussions boards + +Guides for these have been created in their own sections. Before getting started, please introduce yourself in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion. + +### Developing New Features + +We are always keen to add features to Wails and expand on what the project can do. The process for adding new features are as follows: + +- Pick an enhancement ticket with the "TODO" label. It's preferable to select one from the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) but the choice is yours. +- Before developing, check that the ticket includes the following information: + - The purpose of the enhancement + - What is out of scope for the enhancement + - What platforms the enhancement targets (most features should be cross-platform unless there's a very specific reason) +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. Sometimes placeholder tickets are created and require more details +- Comment on the ticket stating if you wish to develop the feature +- Clone the repository and create a branch with the format `feature/_` +- New features often require documentation so please ensure you have also added or updated the documentation as part of the changes +- Once the feature is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all enhancement requests are reviewed for good fit. Not all ideas will be selected, so it's best to have discussion about the enhancement first. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Fixing Bugs + +The process for fixing bugs are as follows: + +- Check the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) and select a bug to fix +- Before developing, check that the ticket includes the following information: +- The scope of the issue including platforms affected +- The steps to reproduce. Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) +- The output of `wails doctor` +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. +- Comment on the ticket stating you wish to develop a fix +- Clone the repository and create a branch with the format `bugfix/_` +- Once the fix is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all bugfixes should be discussed as the approach may have unintended side effects. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Testing + +Testing is vitally important to ensure quality in the project. There are a couple of scenarios where testing can really help the project: + +- Testing if a bug is reproducible on your local system +- Testing PRs to ensure that they work correctly + +If you chose to test if someone's bug report is reproducible on your local system, then feel free to add a comment on the ticket confirming this with the output of `wails doctor`. + +To test PRs, choose a PR to test and check if the PR description has the testing scenarios listed. If not, please ask the person who opened the PR to provide that list. Once you have determined a valid test scenario, please report your findings on the PR. + +If you ever need more clarity or help on testing, please ask a question in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion or on slack. + +### Documenting + +This website is also the main documentation site for the project. Sometimes this gets out of date and needs some slight adjustments. Some of the documentation isn't written to the best standards either. Developing documentation is hard and so any contribution to this is greatly appreciated. Features without documentation are unfinished so to the project, it's _as important_ as the code. + +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. + +To set up a local documentation development environment, do the following: + +- [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. + +#### Versioning + +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. + +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. + +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. + +#### 언어 + +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. + +##### 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. + +### 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 slack channel. 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. + +To join the Wails slack channel, accept the invite [here](https://gophers.slack.com/join/shared_invite/zt-197vymgt3-sJt4oyakb6nqlVKjXTyeVw#/shared-invite/email) and join us on the channel by following [this link](https://gophers.slack.com/?redir=%2Fmessages%2FCJ4P9F7MZ%2F). + +:::note + +Work In Progress + +::: diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx new file mode 100644 index 00000000..2c70c7bb --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/credits.mdx @@ -0,0 +1,199 @@ +# Credits + +- [Lea Anthony](https://github.com/leaanthony) - Project owner, lead developer +- [Stffabi](https://github.com/stffabi) - Technical lead, developer and maintainer +- [Misite Bao](https://github.com/misitebao) - Documentation wizard, Chinese translation, Windows testing, Bug finder general +- [Travis McLane](https://github.com/tmclane) - Cross-compilation work, MacOS testing +- [Byron Chris](https://github.com/bh90210) - Linux distro wizard, Linux testing + +## Sponsors + + +## Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Lea Anthony

💻 🤔 🎨 🖋 💡 🧑‍🏫 📆 🔧 🐛 📝 🚧 📦 👀 💬 🔬 ⚠️ 📢 👀 📖

stffabi

💻 🤔 🎨 🐛 🚧 📦 👀 💬 🔬 👀 📖 ⚠️

Travis McLane

💻 🔬 📦 🤔 🐛 👀 ⚠️ 💬 📖

Misite Bao

📖 🌍 🔬 🚧

Byron Chris

💻 🔬 🚧 🐛 👀 ⚠️ 💬 🤔 🎨 📦 🚇

konez2k

💻 📦 🤔

Dario Emerson

💻 🐛 🤔 ⚠️

Ian M. Jones

💻 🐛 🤔 ⚠️ 👀 📦

marktohark

💻

Ryan H

💻

Cody Bentley

💻 📦 🤔 💵

Florent

💻 🐛

Alexander Hudek

💻 💵

Tim Kipp

💻

Altynbek Kaliakbarov

💻

Nikolai Zimmermann

💻

k-muchmore

💻

Snider

💻 🤔 📖 💵

Albert Sun

💻 ⚠️

Ariel

💻 🐛

Ilgıt Yıldırım

💻 🐛 💵

Toyam Cox

💻 📦 🐛

hi019

💻 🐛

Arthur Wiebe

💻 🐛

Balakrishna Prasad Ganne

💻

BillBuilt

💻 📦 🤔 💬 💵

Eng Zer Jun

🚧 💻

LGiki

📖

Lontten

📖

Lukas Crepaz

💻 🐛

Marcus Crane

🐛 📖 💵

Qais Patankar

📖

Wakeful-Cloud

💻 🐛

Zámbó, Levente

💻 📦 🐛 ⚠️

Ironpark

💻 🤔

mondy

💻 📖

Benjamin Ryan

🐛

fallendusk

📦 💻

Mat Ryer

💻 🤔 🐛

Abtin

💻 🐛

Adrian Lanzafame

📦 💻

Aleksey Polyakov

🐛 💻

Alexander Matviychuk

💻 📦

AlienRecall

💻 📦

Aman

📖

Amaury Tobias Quiroz

💻 🐛

Andreas Wenk

📖

Antonio Stanković

💻 📦

Arpit Jain

📖

Austin Schey

💻 🐛

Benjamin Thomas

💻 📦 🤔

Bertram Truong

💻 🐛

Blake Bourque

📖

Denis

📖

diogox

💻 📦

Dmitry Gomzyakov

💻 📦

Edward Browncross

💻

Elie Grenon

💻

Florian Didron

💻 🐛 🤔 ⚠️ 👀 📦

GargantuaX

💵

Igor Minin

💻 🐛

Jae-Sung Lee

💻 🤔

Jarek

💻 📦

Junker

📖

Kris Raney

💻 🐛

Luken

📖

Mark Stenglein

💻 🐛

buddyabaddon

💻

MikeSchaap

💻 🐛

NYSSEN Michaël

💻 🐛

Nan0

💻 🤔 ⚠️ 👀

oskar

📖

Pierre Joye

💻 🐛 🤔 ⚠️

Reuben Thomas-Davis

💻 🐛

Robin

💻 🐛

Sebastian Bauer

💻 🤔 ⚠️ 👀 💬

Sidharth Rathi

📖 🐛

Sithembiso Khumalo

💻 🐛

Soheib El-Harrache

💻 🐛 💵

Sophie Au

💻 🐛

Stefanos Papadakis

💻 🐛

Steve Chung

💻 🐛

Timm Ortloff

📖

Tom

💻

Valentin Trinqué

💻 🐛

mattn

💻 🐛

bearsh

💻 🤔 📖

chenxiao

💻 🤔 📖

fengweiqiang

💻 📦

flin7

📖

fred21O4

📖

gardc

📖

rayshoo

📖

Ishiyama Yuzuki

💻 🐛

佰阅

💻

刀刀

📖 🐛

归位

💻 🐛

skamensky

💻 🤔 📖

dependabot[bot]

💻 🚧

Damian Sieradzki

💵

John Dorman

💵

Ian Sinnott

💵

Arden Shackelford

💵

Bironou

💵

CharlieGo_

💵

overnet

💵

jugglingjsons

💵

Selvin Ortiz

💵

ZanderCodes

💵

Michael Voronov

💵

letheanVPN

💵

Tai Groot

💵

easy-web-it

💵

Michael Olson

💵

EdenNetwork Italia

💵

ondoki

💵

QuEST Rail LLC

💵

Gilgameš

💵

Bernt-Johan Bergshaven

💵

Liam Bigelow

💵

Nick Arellano

💵

Frank Chiarulli Jr.

💵

Tyler

💵

Trea Hauet

💵

Kent 'picat' Gruber

💵

tc-hib

💵

Antonio

📖

MyNameIsAres

📖

Maicarons J

📖

kiddov

📖 💵 ⚠️ 🤔

Nicolas Coutin

💵

Parvin Eyvazov

📖
+ + + + + + +## Special Mentions + +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version possible. +- [Tad Vizbaras](https://github.com/tadvi) - His winc project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - For advice, support and bants. +- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been invaluable. +- [Justen Walker](https://github.com/justenwalker/) - For helping wrangle COM issues which got v2 over the line. +- [Wang, Chi](https://github.com/patr0nus/) - The DeskGap project was a huge influence on the direction of Wails v2. +- [Serge Zaitsev](https://github.com/zserge) - Whilst Wails does not use the Webview project, it is still a source of inspiration. diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/faq.mdx b/website/i18n/ko/docusaurus-plugin-content-pages/faq.mdx new file mode 100644 index 00000000..98b68d55 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/faq.mdx @@ -0,0 +1,9 @@ +# FAQ + +## What's with the name? + +When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (**W**ebview on R**ails**). It just so happened to also be a homophone of the English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck. + +## Is this an alternative to Electron? + +Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Wails v2 does offer native elements such as menus and dialogs, so it is becoming a lightweight electron alternative. diff --git a/website/i18n/ko/docusaurus-plugin-content-pages/markdown-page.md b/website/i18n/ko/docusaurus-plugin-content-pages/markdown-page.md new file mode 100644 index 00000000..8d402a86 --- /dev/null +++ b/website/i18n/ko/docusaurus-plugin-content-pages/markdown-page.md @@ -0,0 +1,7 @@ +--- +title: 마크다운 페이지 예시 +--- + +# 마크다운 페이지 예시 + +간단한 독립형 페이지를 작성하기 위해 React가 필요하지 않습니다. diff --git a/website/i18n/ko/docusaurus-theme-classic/footer.json b/website/i18n/ko/docusaurus-theme-classic/footer.json index da81b249..5fca1ae9 100644 --- a/website/i18n/ko/docusaurus-theme-classic/footer.json +++ b/website/i18n/ko/docusaurus-theme-classic/footer.json @@ -1,26 +1,26 @@ { "link.title.Docs": { - "message": "Docs", + "message": "문서", "description": "The title of the footer links column with title=Docs in the footer" }, "link.title.Community": { - "message": "Community", + "message": "커뮤니티", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { - "message": "More", + "message": "기타", "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Introduction": { - "message": "Introduction", + "message": "소개", "description": "The label of footer link with label=Introduction linking to /docs/introduction" }, "link.item.label.Getting Started": { - "message": "Getting Started", + "message": "시작하기", "description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation" }, "link.item.label.Changelog": { - "message": "Changelog", + "message": "변경 로그", "description": "The label of footer link with label=Changelog linking to /changelog" }, "link.item.label.Github": { @@ -36,19 +36,19 @@ "description": "The label of footer link with label=Slack linking to https://gophers.slack.com/messages/CJ4P9F7MZ/" }, "link.item.label.Slack invite": { - "message": "Slack invite", + "message": "Slack에 초대", "description": "The label of footer link with label=Slack invite linking to https://invite.slack.golangbridge.org/" }, "link.item.label.Blog": { - "message": "Blog", + "message": "블로그", "description": "The label of footer link with label=Blog linking to /blog" }, - "link.item.label.Awesome": { - "message": "Awesome", - "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" - }, "copyright": { "message": "Copyright © 2022 Lea Anthony", "description": "The footer copyright" + }, + "link.item.label.Awesome": { + "message": "Awesome", + "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" } } diff --git a/website/i18n/ko/docusaurus-theme-classic/navbar.json b/website/i18n/ko/docusaurus-theme-classic/navbar.json index 00196043..33101f21 100644 --- a/website/i18n/ko/docusaurus-theme-classic/navbar.json +++ b/website/i18n/ko/docusaurus-theme-classic/navbar.json @@ -1,42 +1,42 @@ { "item.label.Sponsor": { - "message": "Sponsor", + "message": "스폰서 ❤", "description": "Navbar item with label Sponsor" }, "item.label.Docs": { - "message": "Docs", + "message": "문서", "description": "Navbar item with label Docs" }, "item.label.Blog": { - "message": "Blog", + "message": "블로그", "description": "Navbar item with label Blog" }, - "item.label.About": { - "message": "About", - "description": "Navbar item with label About" - }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" }, + "item.label.About": { + "message": "개요", + "description": "Navbar item with label About" + }, "item.label.FAQ": { "message": "FAQ", "description": "Navbar item with label FAQ" }, "item.label.Changelog": { - "message": "Changelog", + "message": "변경 로그", "description": "Navbar item with label Changelog" }, "item.label.Community Guide": { - "message": "Community Guide", + "message": "커뮤니티 가이드", "description": "Navbar item with label Community Guide" }, - "item.label.Code of Conduct": { - "message": "Code of Conduct", - "description": "Navbar item with label Code of Conduct" - }, "item.label.Credits": { - "message": "Credits", + "message": "크레딧", "description": "Navbar item with label Credits" + }, + "item.label.Code of Conduct": { + "message": "코드 지침", + "description": "Navbar item with label Code of Conduct" } } diff --git a/website/i18n/pt/code.json b/website/i18n/pt/code.json new file mode 100644 index 00000000..c31f2dc2 --- /dev/null +++ b/website/i18n/pt/code.json @@ -0,0 +1,415 @@ +{ + "homepage.Features.Title1": { + "message": "homepage.Features.Title1" + }, + "homepage.Features.Description1": { + "message": "homepage.Features.Description1" + }, + "homepage.Features.Title2": { + "message": "homepage.Features.Title2" + }, + "homepage.Features.Description2": { + "message": "homepage.Features.Description2" + }, + "homepage.Features.Title3": { + "message": "homepage.Features.Title3" + }, + "homepage.Features.Description3": { + "message": "homepage.Features.Description3" + }, + "homepage.Tagline": { + "message": "homepage.Tagline" + }, + "homepage.ButtonText": { + "message": "homepage.ButtonText" + }, + "homepage.LearnMoreButtonText": { + "message": "homepage.LearnMoreButtonText" + }, + "theme.ErrorPageContent.title": { + "message": "This page crashed.", + "description": "The title of the fallback page when the page crashed" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "Try again", + "description": "The label of the button to try again when the page crashed" + }, + "theme.NotFound.title": { + "message": "Página não encontrada", + "description": "The title of the 404 page" + }, + "theme.NotFound.p1": { + "message": "Não foi possível encontrar o que você está procurando.", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "Entre em contato com o proprietário do site que lhe trouxe para cá e lhe informe que o link está quebrado.", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Fechar", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.archive.title": { + "message": "Arquivo", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "Arquivo", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "Volte para o topo", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "Navegação da página de listagem do blog", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "Conteúdo mais novo", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "Conteúdo mais antigo", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.readingTime.plurals": { + "message": "Leitura de um minuto|Leitura de {readingTime} minutos", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.post.readMoreLabel": { + "message": "Read more about {title}", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readMore": { + "message": "Leia Mais", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "Navegação da página de postagem do blog", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "Postagem mais nova", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "Postagem mais antiga", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.blog.post.plurals": { + "message": "Uma postagem|{count} postagens", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} marcadas com \"{tagName}\"", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "Ver todas os Marcadores", + "description": "The label of the link targeting the tag list page" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "Copiar código para a área de transferência", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copied": { + "message": "Copiado", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copy": { + "message": "Copiar", + "description": "The copy button label on code blocks" + }, + "theme.colorToggle.ariaLabel": { + "message": "Switch between dark and light mode (currently {mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "dark mode", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "light mode", + "description": "The name for the light color mode" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count} items", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "Expandir painel lateral", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "Expandir painel lateral", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "Navigação das páginas de documentação", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "Anterior", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "Próxima", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "Fechar painel lateral", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "Fechar painel lateral", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "Toggle the collapsible sidebar category '{label}'", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "Um documento selecionado|{count} documentos selecionados", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged} com \"{tagName}\"", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "Version: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "Esta é uma documentação não lançada para {siteTitle} {versionLabel}.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "Esta é a documentação para {siteTitle} {versionLabel}, que não é mais mantida ativamente.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "Para a documentação atualizada, veja: {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "última versão", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "Editar essa página", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "Link direto para o título", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " em {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " por {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "Última atualização {atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Voltar para o menu principal", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "Versions", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.common.skipToMainContent": { + "message": "Pular para o conteúdo principal", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsListLabel": { + "message": "Marcadores:", + "description": "The label alongside a tag list" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "Nessa página", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "Languages", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.SearchBar.seeAll": { + "message": "See all {count} results" + }, + "theme.SearchBar.label": { + "message": "Buscar", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "Um documento encontrado|{count} documentos encontrados", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "Resultado da busca por \"{query}\"", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "Busca da documentação", + "description": "The search page title for empty query" + }, + "theme.SearchPage.inputPlaceholder": { + "message": "Digite sua busca aqui", + "description": "The placeholder for search page input" + }, + "theme.SearchPage.inputLabel": { + "message": "Buscar", + "description": "The ARIA label for search page input" + }, + "theme.SearchPage.algoliaLabel": { + "message": "Busca feita por Algolia", + "description": "The ARIA label for Algolia mention" + }, + "theme.SearchPage.noResultsText": { + "message": "Nenhum resultado foi encontrado", + "description": "The paragraph for empty search result" + }, + "theme.SearchPage.fetchingNewResults": { + "message": "Trazendo novos resultados...", + "description": "The paragraph for fetching new search results" + }, + "theme.tags.tagsPageTitle": { + "message": "Marcadores", + "description": "The title of the tag list page" + }, + "theme.docs.breadcrumbs.home": { + "message": "Home page", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "Breadcrumbs", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "Toggle word wrap", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.admonition.note": { + "message": "note", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "tip", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.danger": { + "message": "danger", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "info", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.caution": { + "message": "caution", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.SearchModal.searchBox.resetButtonTitle": { + "message": "Clear the query", + "description": "The label and ARIA label for search box reset button" + }, + "theme.SearchModal.searchBox.cancelButtonText": { + "message": "Cancel", + "description": "The label and ARIA label for search box cancel button" + }, + "theme.SearchModal.startScreen.recentSearchesTitle": { + "message": "Recent", + "description": "The title for recent searches" + }, + "theme.SearchModal.startScreen.noRecentSearchesText": { + "message": "No recent searches", + "description": "The text when no recent searches" + }, + "theme.SearchModal.startScreen.saveRecentSearchButtonTitle": { + "message": "Save this search", + "description": "The label for save recent search button" + }, + "theme.SearchModal.startScreen.removeRecentSearchButtonTitle": { + "message": "Remove this search from history", + "description": "The label for remove recent search button" + }, + "theme.SearchModal.startScreen.favoriteSearchesTitle": { + "message": "Favorite", + "description": "The title for favorite searches" + }, + "theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": { + "message": "Remove this search from favorites", + "description": "The label for remove favorite search button" + }, + "theme.SearchModal.errorScreen.titleText": { + "message": "Unable to fetch results", + "description": "The title for error screen of search modal" + }, + "theme.SearchModal.errorScreen.helpText": { + "message": "You might want to check your network connection.", + "description": "The help text for error screen of search modal" + }, + "theme.SearchModal.footer.selectText": { + "message": "to select", + "description": "The explanatory text of the action for the enter key" + }, + "theme.SearchModal.footer.selectKeyAriaLabel": { + "message": "Enter key", + "description": "The ARIA label for the Enter key button that makes the selection" + }, + "theme.SearchModal.footer.navigateText": { + "message": "to navigate", + "description": "The explanatory text of the action for the Arrow up and Arrow down key" + }, + "theme.SearchModal.footer.navigateUpKeyAriaLabel": { + "message": "Arrow up", + "description": "The ARIA label for the Arrow up key button that makes the navigation" + }, + "theme.SearchModal.footer.navigateDownKeyAriaLabel": { + "message": "Arrow down", + "description": "The ARIA label for the Arrow down key button that makes the navigation" + }, + "theme.SearchModal.footer.closeText": { + "message": "to close", + "description": "The explanatory text of the action for Escape key" + }, + "theme.SearchModal.footer.closeKeyAriaLabel": { + "message": "Escape key", + "description": "The ARIA label for the Escape key button that close the modal" + }, + "theme.SearchModal.footer.searchByText": { + "message": "Search by", + "description": "The text explain that the search is making by Algolia" + }, + "theme.SearchModal.noResultsScreen.noResultsText": { + "message": "No results for", + "description": "The text explains that there are no results for the following search" + }, + "theme.SearchModal.noResultsScreen.suggestedQueryText": { + "message": "Try searching for", + "description": "The text for the suggested query when no results are found for the following search" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsText": { + "message": "Believe this query should return results?", + "description": "The text for the question where the user thinks there are missing results" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": { + "message": "Let us know.", + "description": "The text for the link to report missing results" + }, + "theme.SearchModal.placeholder": { + "message": "Search docs", + "description": "The placeholder of the input of the DocSearch pop-up modal" + } +} diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx b/website/i18n/pt/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx new file mode 100644 index 00000000..5f4ea285 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx @@ -0,0 +1,161 @@ +--- +slug: wails-v2-beta-for-windows +title: Wails v2 Beta for Windows +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +When I first announced Wails on Reddit, just over 2 years ago from a train in Sydney, I did not expect it to get much attention. A few days later, a prolific tech vlogger released a tutorial video, gave it a positive review and from that point on, interest in the project has skyrocketed. + +It was clear that people were excited about adding web frontends to their Go projects, and almost immediately pushed the project beyond the proof of concept that I had created. At the time, Wails used the [webview](https://github.com/webview/webview) project to handle the frontend, and the only option for Windows was the IE11 renderer. Many bug reports were rooted in this limitation: poor JavaScript/CSS support and no dev tools to debug it. This was a frustrating development experience but there wasn't much that could have been done to rectify it. + +For a long time, I'd firmly believed that Microsoft would eventually have to sort out their browser situation. The world was moving on, frontend development was booming and IE wasn't cutting it. When Microsoft announced the move to using Chromium as the basis for their new browser direction, I knew it was only a matter of time until Wails could use it, and move the Windows developer experience to the next level. + +Today, I am pleased to announce: **Wails v2 Beta for Windows**! There's a huge amount to unpack in this release, so grab a drink, take a seat and we'll begin... + +### No CGO Dependency! + +No, I'm not joking: _No_ _CGO_ _dependency_ 🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path. + +### WebView2 Chromium Renderer + +```mdx-code-block +
+ +
+
+``` + +Finally, Windows developers get a first class rendering engine for their applications! Gone are the days of contorting your frontend code to work on Windows. On top of that, you get a first-class developer tools experience! + +The WebView2 component does, however, have a requirement to have the `WebView2Loader.dll` sitting alongside the binary. This makes distribution just that little bit more painful than we gophers are used to. All solutions and libraries (that I know of) that use WebView2 have this dependency. + +However, I'm really excited to announce that Wails applications _have no such requirement_! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk. + +Gophers rejoice! The single binary dream lives on! + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +There is now the option to generate IDE configuration along with your project. This means that if you open your project in a supported IDE, it will already be configured for building and debugging your application. Currently VSCode is supported but we hope to support other IDEs such as Goland soon. + +```mdx-code-block +
+ +
+
+``` + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +```mdx-code-block +
+ +
+
+``` + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Modelos Remotos + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### In Conclusion + +Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome. Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +There were many twists and turns, pivots and u-turns to get to this point. This was due partly to early technical decisions that needed changing, and partly because some core problems we had spent time building workarounds for were fixed upstream: Go’s embed feature is a good example. Fortunately, everything came together at the right time, and today we have the very best solution that we can have. I believe the wait has been worth it - this would not have been possible even 2 months ago. + +I also need to give a huge thank you :pray: to the following people because without them, this release just wouldn't exist: + +- [Misite Bao](https://github.com/misitebao) - An absolute workhorse on the Chinese translations and an incredible bug finder. +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version we have today possible. +- [Tad Vizbaras](https://github.com/tadvi) - Experimenting with his [winc](https://github.com/tadvi/winc) project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - His support, encouragement and feedback has really helped drive the project forward. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: MacOS and Linux users need not feel left out - porting to this new foundation is actively under way and most of the hard work has already been done. Hang in there! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx b/website/i18n/pt/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx new file mode 100644 index 00000000..28d9d42d --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx @@ -0,0 +1,170 @@ +--- +slug: wails-v2-beta-for-mac +title: Wails v2 Beta for MacOS +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Today marks the first beta release of Wails v2 for Mac! It's taken quite a while to get to this point and I'm hoping that today's release will give you something that's reasonably useful. There have been a number of twists and turns to get to this point and I'm hoping, with your help, to iron out the crinkles and get the Mac port polished for the final v2 release. + +You mean this isn't ready for production? For your use case, it may well be ready, but there are still a number of known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would like to contribute, you'd be very welcome! + +So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### Mac Specific Options + +In addition to the normal application options, Wails v2 for Mac also brings some Mac extras: + +- Make your window all funky and translucent, like all the pretty swift apps! +- Highly customisable titlebar +- We support the NSAppearance options for the application +- Simple config to auto-create an "About" menu + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Modelos Remotos + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Native M1 Support + +Thanks to the amazing support of [Mat Ryer](https://github.com/matryer/), the Wails project now supports M1 native builds: + +```mdx-code-block +
+ +
+
+``` + +You can also specify `darwin/amd64` as a target too: + +```mdx-code-block +
+ +
+
+``` + +Oh, I almost forgot.... you can also do `darwin/universal`.... :wink: + +```mdx-code-block +
+ +
+
+``` + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### WKWebView Renderer + +V1 relied on a (now deprecated) WebView component. V2 uses the most recent WKWebKit component so expect the latest and greatest from Apple. + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: Linux users, you're next! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx b/website/i18n/pt/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx new file mode 100644 index 00000000..2cdea89e --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx @@ -0,0 +1,114 @@ +--- +slug: wails-v2-beta-for-linux +title: Wails v2 Beta for Linux +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +I'm pleased to finally announce that Wails v2 is now in beta for Linux! It is somewhat ironic that the very first experiments with v2 was on Linux and yet it has ended up as the last release. That being said, the v2 we have today is very different from those first experiments. So without further ado, let's go over the new features: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Modelos Remotos + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +Linux is **hard** to support. We expect there to be a number of quirks with the beta. Please help us to help you by filing detailed bug reports! + +Finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors) whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: The v2 release isn't far off now! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx b/website/i18n/pt/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx new file mode 100644 index 00000000..e9d570af --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx @@ -0,0 +1,98 @@ +--- +slug: wails-v2-released +title: Wails v2 Released +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +# It's here! + +Today marks the release of [Wails](https://wails.io) v2. It's been about 18 months since the first v2 alpha and about a year from the first beta release. I'm truly grateful to everyone involved in the evolution of the project. + +Part of the reason it took that long was due to wanting to get to some definition of completeness before officially calling it v2. The truth is, there's never a perfect time to tag a release - there's always outstanding issues or "just one more" feature to squeeze in. What tagging an imperfect major release does do, however, is to provide a bit of stability for users of the project, as well as a bit of a reset for the developers. + +This release is more than I'd ever expected it to be. I hope it gives you as much pleasure as it has given us to develop it. + +# What _is_ Wails? + +If you are unfamiliar with Wails, it is a project that enables Go programmers to provide rich frontends for their Go programs using familiar web technologies. It's a lightweight, Go alternative to Electron. Much more information can be found on the [official site](https://wails.io/docs/introduction). + +# What's new? + +The v2 release is a huge leap forward for the project, addressing many of the pain points of v1. If you have not read any of the blog posts on the Beta releases for [macOS](/blog/wails-v2-beta-for-mac), [Windows](/blog/wails-v2-beta-for-windows) or [Linux](/blog/wails-v2-beta-for-linux), then I encourage you to do so as it covers all the major changes in more detail. In summary: + +- Webview2 component for Windows that supports modern web standards and debugging capabilities. +- [Dark / Light theme](/docs/reference/options#theme) + [custom theming](/docs/reference/options#customtheme) on Windows. +- Windows now has no CGO requirements. +- Out-of-the-box support for Svelte, Vue, React, Preact, Lit & Vanilla project templates. +- [Vite](https://vitejs.dev/) integration providing a hot-reload development environment for your application. +- Native application [menus](/docs/guides/application-development#application-menu) and [dialogs](/docs/reference/runtime/dialog). +- Native window translucency effects for [Windows](/docs/reference/options#windowistranslucent) and [macOS](/docs/reference/options#windowistranslucent-1). Support for Mica & Acrylic backdrops. +- Easily generate an [NSIS installer](/docs/guides/windows-installer) for Windows deployments. +- A rich [runtime library](/docs/reference/runtime/intro) providing utility methods for window manipulation, eventing, dialogs, menus and logging. +- Support for [obfuscating](/docs/guides/obfuscated) your application using [garble](https://github.com/burrowers/garble). +- Support for compressing your application using [UPX](https://upx.github.io/). +- Automatic Typescript generation of Go structs. More info [here](/docs/howdoesitwork#calling-bound-go-methods). +- No extra libraries or DLLs are required to be shipped with your application. For any platform. +- No requirement to bundle frontend assets. Just develop your application like any other web application. + +# Credit & Thanks + +Getting to v2 has been a huge effort. There have been ~2.2K commits by 89 contributors between the initial alpha and the release today, and many, many more that have provided translations, testing, feedback and help on the discussion forums as well as the issue tracker. I'm so unbelievably grateful to each one of you. I'd also like to give an extra special thank you to all the project sponsors who have provided guidance, advice and feedback. Everything you do is hugely appreciated. + +There are a few people I'd like to give special mention to: + +Firstly, a **huge** thank you to [@stffabi](https://github.com/stffabi) who has provided so many contributions which we all benefit from, as well as providing a lot of support on many issues. He has provided some key features such as the external dev server support which transformed our dev mode offering by allowing us to hook into [Vite](https://vitejs.dev/)'s superpowers. It's fair to say that Wails v2 would be a far less exciting release without his [incredible contributions](https://github.com/wailsapp/wails/commits?author=stffabi&since=2020-01-04). Thank you so much @stffabi! + +I'd also like to give a huge shout-out to [@misitebao](https://github.com/misitebao) who has tirelessly been maintaining the website, as well as providing Chinese translations, managing Crowdin and helping new translators get up to speed. This is a hugely important task, and I'm extremely grateful for all the time and effort put into this! You rock! + +Last, but not least, a huge thank you to Mat Ryer who has provided advice and support during the development of v2. Writing xBar together using an early Alpha of v2 was helpful in shaping the direction of v2, as well as give me an understanding of some design flaws in the early releases. I'm happy to announce that as of today, we will start to port xBar to Wails v2, and it will become the flagship application for the project. Cheers Mat! + +# Lessons Learnt + +There are a number of lessons learnt in getting to v2 that will shape development moving forward. + +## Smaller, Quicker, Focused Releases + +In the course of developing v2, there were many features and bug fixes that were developed on an ad-hoc basis. This led to longer release cycles and were harder to debug. Moving forward, we are going to create releases more often that will include a reduced number of features. A release will involve updates to documentation as well as thorough testing. Hopefully, these smaller, quicker, focussed releases will lead to fewer regressions and better quality documentation. + +## Encourage Engagement + +When starting this project, I wanted to immediately help everyone who had a problem. Issues were "personal" and I wanted them resolved as quickly as possible. This is unsustainable and ultimately works against the longevity of the project. Moving forward, I will be giving more space for people to get involved in answering questions and triaging issues. It would be good to get some tooling to help with this so if you have any suggestions, please join in the discussion [here](https://github.com/wailsapp/wails/discussions/1855). + +## Learning to say No + +The more people that engage with an Open Source project, the more requests there will be for additional features that may or may not be useful to the majority of people. These features will take an initial amount of time to develop and debug, and incur an ongoing maintenance cost from that point on. I myself am the most guilty of this, often wanting to "boil the sea" rather than provide the minimum viable feature. Moving forward, we will need to say "No" a bit more to adding core features and focus our energies on a way to empower developers to provide that functionality themselves. We are looking seriously into plugins for this scenario. This will allow anyone to extend the project as they see fit, as well as providing an easy way to contribute towards the project. + +# Looking to the Future + +There are so many core features we are looking at to add to Wails in the next major development cycle already. The [roadmap](https://github.com/wailsapp/wails/discussions/1484) is full of interesting ideas, and I'm keen to start work on them. One of the big asks has been for multiple window support. It's a tricky one and to do it right, and we may need to look at providing an alternative API, as the current one was not designed with this in mind. Based on some preliminary ideas and feedback, I think you'll like where we're looking to go with it. + +I'm personally very excited at the prospect of getting Wails apps running on mobile. We already have a demo project showing that it is possible to run a Wails app on Android, so I'm really keen to explore where we can go with this! + +A final point I'd like to raise is that of feature parity. It has long been a core principle that we wouldn't add anything to the project without there being full cross-platform support for it. Whilst this has proven to be (mainly) achievable so far, it has really held the project back in releasing new features. Moving forward, we will be adopting a slightly different approach: any new feature that cannot be immediately released for all platforms will be released under an experimental configuration or API. This allows early adopters on certain platforms to try the feature and provide feedback that will feed into the final design of the feature. This, of course, means that there are no guarantees of API stability until it is fully supported by all the platforms it can be supported on, but at least it will unblock development. + +# Final Words + +I'm really proud of what we've been able to achieve with the V2 release. It's amazing to see what people have already been able to build using the beta releases so far. Quality applications like [Varly](https://varly.app/), [Surge](https://getsurge.io/) and [October](https://october.utf9k.net/). I encourage you to check them out. + +This release was achieved through the hard work of many contributors. Whilst it is free to download and use, it has not come about through zero cost. Make no mistakes, this project has come at considerable cost. It has not only been my time and the time of each and every contributor, but also the cost of absence from friends and families of each of those people too. That's why I'm extremely grateful for every second that has been dedicated to making this project happen. The more contributors we have, the more this effort can be spread out and the more we can achieve together. I'd like to encourage you all to pick one thing that you can contribute, whether it is confirming someone's bug, suggesting a fix, making a documentation change or helping out someone who needs it. All of these small things have such a huge impact! It would be so awesome if you too were part of the story in getting to v3. + +Enjoy! + +‐ Lea + +PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/authors.yml b/website/i18n/pt/docusaurus-plugin-content-blog/authors.yml new file mode 100644 index 00000000..d7d3e81e --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/authors.yml @@ -0,0 +1,10 @@ +leaanthony: + name: Lea Anthony + title: Mantenedor do Wails + url: https://github.com/leaanthony + image_url: https://github.com/leaanthony.png +misitebao: + name: Misite Bao + title: Arquiteto + url: https://github.com/misitebao + image_url: https://github.com/misitebao.png diff --git a/website/i18n/pt/docusaurus-plugin-content-blog/options.json b/website/i18n/pt/docusaurus-plugin-content-blog/options.json new file mode 100644 index 00000000..d38f10d1 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Postagens recentes", + "description": "The label for the left sidebar" + } +} diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current.json b/website/i18n/pt/docusaurus-plugin-content-docs/current.json new file mode 100644 index 00000000..3e31c2c3 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "Próxima Versão 🚧", + "description": "The label for version current" + }, + "sidebar.docs.category.Getting Started": { + "message": "Guia de Introdução", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Referências", + "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": "Comunidade", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Demonstração", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guias", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contribuição", + "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-docs/current/community/links.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/links.mdx new file mode 100644 index 00000000..f3cbf4a9 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/links.mdx @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +--- + +# Links + +Esta página serve como uma lista para links da comunidade relacionados. Envie um PR (clique `Editar esta página` na parte inferior) para enviar links. + +## Awesome Wails + +A [lista definitiva](https://github.com/wailsapp/awesome-wails) dos links relacionados à Wails. + +## Canais de Suporte + +- [Gophers Slack Channel](https://gophers.slack.com/messages/CJ4P9F7MZ/) +- [Gophers Slack Channel Invite](https://invite.slack.golangbridge.org/) +- [Github Issues](https://github.com/wailsapp/wails/issues) +- [v2 Beta Discussion Board](https://github.com/wailsapp/wails/discussions/828) + +## Redes Sociais + +- [Twitter](https://twitter.com/wailsapp) +- [Wails Chinese Community QQ Group](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Group number: 1067173054 + +## Outros tutoriais e Artigos +- [Building of Bulletin Board](https://blog.customct.com/building-bulletin-board) diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx new file mode 100644 index 00000000..04150ba2 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx @@ -0,0 +1,10 @@ +# EmailIt + +```mdx-code-block +

+ +
+

+``` + +[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 builtin [Node-Red](https://nodered.org/) server, scripts terminal, and the [ScriptBar](https://github.com/raguay/ScriptBarApp) program for displaying results from Node-Red or a script on your system. Documentation is very scarce, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx new file mode 100644 index 00000000..a5692d35 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx @@ -0,0 +1,12 @@ +# EncryptEasy + +```mdx-code-block +

+ +
+

+``` + +**[EncryptEasy](https://www.encrypteasy.app) é uma ferramenta simples e fácil de usar de criptografia PGP, gerenciando todas as suas chaves de contato e suas chaves. A criptografia deve ser simples. Desenvolvido com Wails.** + +Criptografar mensagens usando PGP é o padrão da indústria. Todos têm uma chave privada e pública. A sua chave privada precisa ser privada para que apenas você possa ler as mensagens. Sua chave pública é distribuída para qualquer pessoa que queira lhe enviar o segredo, mensagens criptografadas. Gerenciar chaves, criptografar mensagens e descriptografar mensagens devem ser uma experiência suave. EncryptEasy é sobre facilitar o processo. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx new file mode 100644 index 00000000..48010ca6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx @@ -0,0 +1,16 @@ +# Utilitário de Exportação FileHound + +```mdx-code-block +

+ +
+

+``` + +[Utilitário de exportação de FileHound](https://www.filehound.co.uk/) FileHound é uma plataforma de gerenciamento de documentos em nuvem feita para retenção segura de arquivos, automação de processos de negócio e recursos de SmartCaptura. + +O Utilitário de Exportação FileHound permite os admnistradores FileHound a capacidade de executar um documento seguro e extração de tarefas para um backup alternativo. Esta aplicação irá baixar todos os documentos e/ou meta dados salvos no FileHound com base nos filtros que você escolher. Os metadados serão exportados em ambos os formatos JSON e XML. + +Backend construído com: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2 + +Frontend com: Vue 2.6.11 Vuex 3.4.0 Typescript Tailwind 1.9.6 diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx new file mode 100644 index 00000000..d606f87f --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx @@ -0,0 +1,14 @@ +# Atualizador do Minecraft + +```mdx-code-block +

+ +
+

+``` + +[O atualziador do Minecraft](https://github.com/Gurkengewuerz/MinecraftModUpdater) é uma ferramenta utilitária para atualizar e sincronizar mods do Minecraft para sua base de usuários. Ele é construído usando Wails2 e React com [antd](https://ant.design/) como framework frontend. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx new file mode 100644 index 00000000..d9823ac2 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -0,0 +1,14 @@ +# Gerenciador de arquivos Modal + +```mdx-code-block +

+ +
+

+``` + +[Gerenciador de Arquivos Modal](https://github.com/raguay/ModalFileManager) é um gerenciador de arquivos dual pane usando tecnologias da web. Meu design original foi baseado em NW.js e pode ser encontrado [aqui](https://github.com/raguay/ModalFileManager-NWjs). Esta versão usa o mesmo código de frontend baseado em Svelte (mas foi muito modificado desde a partida do NW.), mas o backend implementado com [Wails 2](https://wails.io/). Ao usar esta implementação, eu não uso mais comandos de linha de comando `rm`, `cp`, etc. Está totalmente codificado usando Go e roda muito mais rápido do que as versões anteriores. + +Este gerenciador de arquivos é projetado em torno do mesmo princípio do Vim: uma ação controlada pelo teclado. O número de estados não é fixo, mas muito programável. Portanto, um número infinito de configurações de teclado pode ser criado e usado. Esta é a principal diferença em relação a outros gerenciadores de arquivos. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx new file mode 100644 index 00000000..a0570d03 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx @@ -0,0 +1,10 @@ +# Molley Wallet + +```mdx-code-block +

+ +
+

+``` + +[Molley Wallet](https://github.com/grvlle/constellation_wallet/) a carteira oficial $DAG da rede Constellation. Ele permitirá que os usuários interajam com a Rede Hypergraph de várias maneiras, não limitado à produção de $DAG transações. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/october.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/october.mdx new file mode 100644 index 00000000..0069bae7 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/october.mdx @@ -0,0 +1,14 @@ +# October + +```mdx-code-block +

+ +
+

+``` + +[Constellation ](https://october.utf9k.net) é uma pequena aplicação de Wails que facilita muito a extração de destaques de [Kobo eReaders](https://en.wikipedia.org/wiki/Kobo_eReader) e então os encaminha para [Readwise](https://readwise.io). + +Tem um escopo relativamente pequeno com todas as versões de plataforma pesando abaixo de 10MB, e isso é sem habilitar [a compressão UPX](https://upx.github.io/)! + +Em contraste, as tentativas anteriores do autor com o Electron rapidamente incharam várias centenas de megabytes. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx new file mode 100644 index 00000000..606d5c4a --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx @@ -0,0 +1,10 @@ +# Optimus + +```mdx-code-block +

+ +
+

+``` + +[Optimus](https://github.com/splode/optimus) é uma aplicação de otimização de imagem para área de trabalho. Ele suporta conversão e compressão entre formatos de imagem WebP, JPEG e PNG. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx new file mode 100644 index 00000000..4db08021 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx @@ -0,0 +1,10 @@ +# Portfall + +```mdx-code-block +

+ +
+

+``` + +[Portfall](https://github.com/rekon-oss/portfall) - Um portal de encaminhamento de porta para desktop para fácil acesso a todas as suas interfaces diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx new file mode 100644 index 00000000..fbe86fd6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx @@ -0,0 +1,12 @@ +# Restic Browser + +```mdx-code-block +

+ +
+

+``` + +[Restic-Browser](https://github.com/emuell/restic-browser) - Uma GUI de backup simples e multiplataforma [restica](https://github.com/restic/restic) para navegação e restauração de repositórios resóticos. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx new file mode 100644 index 00000000..961debad --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx @@ -0,0 +1,21 @@ +# RiftShare + +```mdx-code-block +

+ +
+

+``` + +Compartilhamento de arquivos fácil, seguro e gratuito para todos. Saiba mais em [Riftshare.app](https://riftshare.app) + +## Funcionalidades + +- Compartilhamento fácil e seguro de arquivos entre computadores tanto na rede local quanto através da internet +- Suporta o envio de arquivos ou diretórios de forma segura através do [magic wormhole protocol](https://magic-wormhole.readthedocs.io/en/latest/) +- Compatível com todos os outros aplicativos que usam magic wormhole (magic-wormhole ou wormhole-william CLI, wormhole-gui, etc.) +- Compactação automática de vários arquivos selecionados para enviar de uma vez +- Animações completas, barra de progresso e cancelamento do suporte para envio e recebimento +- Seleção de arquivo Native OS +- Abrir arquivos em um clique uma vez recebido +- Atualização Automática - não se preocupe em ter a versão mais recente! diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx new file mode 100644 index 00000000..d32118c0 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -0,0 +1,10 @@ +# ScriptBar + +```mdx-code-block +

+ +
+

+``` + +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) é um programa que mostra a saída do servidor embutido [Node-Red](https://nodered.org) no aplicativo [EmailIt](https://GitHub.com/raguay/EmailIt). Também exibe a saída de scripts no seu sistema. ScriptBar não os coloca na barra de menus, mas os tenha todos em uma janela convidada para fácil visualização. Você pode ter várias abas para ter muitas coisas diferentes mostradas. Você também pode manter os links para os sites mais visitados. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx new file mode 100644 index 00000000..78db0e7b --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx @@ -0,0 +1,10 @@ +# Surge + +```mdx-code-block +

+ +
+

+``` + +[Surge](https://getsurge.io/) é um aplicativo de compartilhamento de arquivos p2p projetado para utilizar tecnologias blockchain para habilitar transferências de arquivos 100% anônimas. O Surgeé criptografado, descentralizado e de código aberto. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx new file mode 100644 index 00000000..8b2f2c6c --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx @@ -0,0 +1,10 @@ +# Wally + +```mdx-code-block +

+ +
+

+``` + +[Wally](https://ergodox-ez.com/pages/wally) é o flasher oficial para os teclados [Ergodox](https://ergodox-ez.com/). Parece excelente e é um exemplo fantástico do que você pode conseguir com o Wails: a capacidade de combinar o poder do Go e as ricas ferramentas gráficas do mundo de desenvolvimento web. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx new file mode 100644 index 00000000..d2e5eaf3 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx @@ -0,0 +1,10 @@ +# Wombat + +```mdx-code-block +

+ +
+

+``` + +[Wombat](https://github.com/rogchap/wombat) é um cliente gRPC multiplataforma. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx new file mode 100644 index 00000000..01a56449 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx @@ -0,0 +1,10 @@ +# Ytd + +```mdx-code-block +

+ +
+

+``` + +[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails) é um aplicativo para baixar faixas do youtube, criar listas de reprodução offline e compartilhar com seus amigos, seus amigos poderão reproduzir suas playlists ou baixá-las para escuta offline, tem um player embutido. 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 new file mode 100644 index 00000000..264b2502 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -0,0 +1,56 @@ +--- +sidebar_position: 1 +--- + +# Templates + +Esta página serve como uma lista para modelos suportados pela comunidade. Por favor, envie um PR (clique `Editar esta página` na parte inferior) para incluir seus modelos. Para construir seu próprio modelo, consulte o guia de [Modelos](../guides/templates.mdx). + +Para usar estes templates, execute `wails init -n "Seu Nome do Projeto" -t [o link abaixo[@version]]` + +Se não houver nenhum sufixo de versão, o modelo de código principal da branch é usado por padrão. Se houver um sufixo de versão, o template de código correspondente à tag desta versão é usado. + +Exemplo: `wails init -n "Seu Nome do Projeto" -t https://github.com/misitebao/wails-template-vue` + +:::warning Atenção + +**O projeto Wails não é mantido, não é responsável nem responsável por modelos de terceiros!** + +Se você não tiver certeza sobre um template, inspecione `package.json` e `wails.json` para quais scripts são executados e quais pacotes estão instalados. + +::: + +## Vue + +- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - Wails template based on Vue ecology (Integrated TypeScript, Dark theme, Internationalization, Single page routing, TailwindCSS) +- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript with Vite (and instructions to add features) +- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier +- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - A template using JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) +- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - A template using TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API with <script setup>) + +## Angular + +- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n + +## React + +- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - A template using reactjs +- [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 + +## 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-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit + +## Elm + +- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket: +- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Combine the powers :muscle: of Elm + Tailwind CSS + Wails! Hot reloading supported. + +## Pure JavaScript (Vanilla) + +- [wails-pure-js-template](https://github.com/KiddoV/wails-pure-js-template) - A template with nothing but just basic JavaScript, HTML, and CSS diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx new file mode 100644 index 00000000..d06faa9e --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx @@ -0,0 +1,22 @@ +--- +sidebar_position: 6 +--- + +# Compilando seu projeto + +No diretório do projeto, execute `wails builds`. Isso compilará seu projeto e salvará o binário pronto para produção no diretório `build/bin`. + +Se você executar o binário, você verá a aplicação padrão: + +```mdx-code-block +
+ +
+
+``` + +Para mais detalhes sobre as opções de compilação, consulte a [Referência do CLI](../reference/cli.mdx#build). diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx new file mode 100644 index 00000000..39c94e87 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx @@ -0,0 +1,16 @@ +--- +sidebar_position: 5 +--- + +# Desenvolvendo sua aplicação + +Você pode executar sua aplicação no modo de desenvolvimento executando `wails dev` no diretório do seu projeto. Isso fará o seguinte: + +- Construa seu aplicativo e o execute +- Vincula seu código Go para o frontend para que ele possa ser chamado a partir de Javascript +- Usando o poder do [Vite](https://vitejs.dev/), observará modificações em seus arquivos Go e reconstruir/re-executar na alteração +- Configure um [servidor web](http://localhost:34115) que irá servir seu aplicativo em um navegador. Isso permite usar suas extensões de navegador favoritas. Você pode até mesmo chamar seu código Go do console + +Para começar, execute `wails dev` no diretório do projeto. Mais informações sobre isso podem ser encontradas [aqui](../reference/cli.mdx#dev). + +Em breve: Tutorial diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx new file mode 100644 index 00000000..7b646835 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 2 +--- + +# Criando um projeto + +## Geração de Projeto + +Agora que o CLI está instalado, você pode gerar um novo projeto usando o comando `wails init`. + +Escolha seu framework favorito: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Generate a Svelte project using Javascript with:

+ + wails init -n myproject -t svelte + +If you would rather use Typescript:
+ + wails init -n myproject -t svelte-ts + +
+ + Generate a React project using Javascript with:

+ + wails init -n myproject -t react + +If you would rather use Typescript:
+ + wails init -n myproject -t react-ts + +
+ + Generate a Vue project using Javascript with:

+ + wails init -n myproject -t vue + +If you would rather use Typescript:
+ + wails init -n myproject -t vue-ts + +
+ + Generate a Preact project using Javascript with:

+ + wails init -n myproject -t preact + +If you would rather use Typescript:
+ + wails init -n myproject -t preact-ts + +
+ + Generate a Lit project using Javascript with:

+ + wails init -n myproject -t lit + +If you would rather use Typescript:
+ + wails init -n myproject -t lit-ts + +
+ + Generate a Vanilla project using Javascript with:

+ + wails init -n myproject -t vanilla + +If you would rather use Typescript:
+ + wails init -n myproject -t vanilla-ts + +
+
+``` + +
+ +Há também [templates da comunidade](../community/templates.mdx) disponíveis que oferecem diferentes recursos e frameworks. + +Para ver as outras opções disponíveis, você pode executar `wails init -help`. Mais detalhes podem ser encontrados na [Referência da CLI](../reference/cli.mdx#init). + +## Layout do Projeto + +Os projetos Wails possuem o seguinte layout: + +``` +. +├── build/ +│ ├── appicon.png +│ ├── darwin/ +│ └── windows/ +├── frontend/ +├── go.mod +├── go.sum +├── main.go +└── wails.json +``` + +### Estrutura do projeto em execução + +- `/main.go` - A aplicação principal +- `/frontend/` - Arquivos do Frontend do projeto +- `/build/` - Diretório de compilação do projeto +- `/build/appicon.png` - O ícone da aplicação +- `/build/darwin/` - Arquivos do projeto específicos do Mac +- `/build/windows/` - Arquivos de projeto específicos do Windows +- `/wails.json` - A configuração do projeto +- `/go.mod` - O arquivo de módulos do Go +- `/go.sum` - O arquivo de checagem dos módulos do Go + +O diretório `frontend` não tem nada específico para o Wails e pode ser qualquer projeto frontend de sua escolha. + +O diretório `build` é usado durante o processo de compilação. Esses arquivos podem ser atualizados para personalizar suas compilações. Se arquivos forem removidos do diretório de compilação, as versões padrão serão restauradas. + +O nome do módulo padrão em `go.mod` é "changeme". Você deveria mudar isso para algo mais apropriado. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx new file mode 100644 index 00000000..11ae360a --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx @@ -0,0 +1,90 @@ +--- +sidebar_position: 1 +--- + +# Instalação + +## Plataformas Suportadas + +- Windows 10/11 AMD64/ARM64 +- MacOS 10.13+ AMD64 +- MacOS 11.0+ ARM64 +- Linux AMD64/ARM64 + +## Dependências + +O Wails tem várias dependências comuns que são necessárias antes da instalação: + +- Go 1.18+ +- NPM (Node 15+) + +### Go + +Baixe o Go direto da [página de download do Go](https://go.dev/dl/). + +Certifique-se de seguir as [instruções oficiais de instalação do Go](https://go.dev/doc/install). Você também precisará garantir que sua `variável de ambiente PATH` também inclua o caminho para o seu diretório `~/go/bin`. Reinicie seu terminal e faça as seguintes verificações: + +- Verificar se o Go está instalado corretamente: `go version` +- Cheque se `~/go/bin` está nas suas variáveis de ambiente `echo $PATH | grep go/bin` + +### NPM + +Baixe o NPM da [Página de downloads do Node](https://nodejs.org/en/download/). É melhor usar o último lançamento, pois é isso que costumamos testar. + +Execute `npm --version` para verificar. + +## Dependências específicas da plataforma + +Você também precisará instalar as dependências específicas da plataforma: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Wails requires that the xcode command line tools are installed. This can be + done by running xcode-select --install. + + + Wails requires that the WebView2 runtime is installed. Algumas instalações do Windows já terão isto instalado. Você pode conferir usando o comando do wails doctor. + + + Linux required the standard gcc build tools plus libgtk3 and libwebkit. Ao invés de listar uma tonelada de comandos para diferentes distros, os Wails podem tentar determinar quais são os comandos de instalação para sua distribuição específica. Execute o wails doctor após a instalação para ser mostrado como instalar as dependencias. Se o seu gerenciador de destro/pacote não for suportado, por favor, consulte o guia Adicionar Distro do Linux. + + +``` + +## Dependências opcionais + +- [UPX](https://upx.github.io/) para comprimir suas aplicações. +- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers. + +## Instalando Wails + +Execute `instale github.com/wailsapp/wails/v2/cmd/wails@latest` para instalar a CLI do Wails. + +Note: If you get an error similar to this: + +```shell +....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found +``` +please check you have Go 1.18+ installed: +```shell +go version +``` + +## Verificação do sistema + +Ao executar `wails doctor ` verificará quais dependências estão instaladas corretamente. Caso contrário, aconselhará sobre o que está em falta e ajudará a corrigir quaisquer problemas. + +## O comando `wail` parece estar faltando? + +Se o sistema está relatando que o comando `wail` está faltando, certifique-se de ter seguido o guia de instalação corretamente. Normalmente, isso significa que o diretório `go/bin` no diretório do seu usuário não está na variável do ambiente `PATH`. Você normalmente também precisará fechar e reabrir qualquer prompt de comando aberto para que as alterações no ambiente feitas pelo instalador sejam refletidas no prompt de comando. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/angular.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/angular.mdx new file mode 100644 index 00000000..2b6c5a84 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/angular.mdx @@ -0,0 +1,14 @@ +# Angular + +Whilst Wails does not have an Angular template, it is possible to use Angular with Wails. + +## Dev Mode + +To get dev mode working with Angular, you need to add the following to your `wails.json`: + +```json + "frontend:build": "npx ng build", + "frontend:install": "npm install", + "frontend:dev:watcher": "npx ng serve", + "frontend:dev:serverUrl": "http://localhost:4200", +``` \ No newline at end of file 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 new file mode 100644 index 00000000..d03f38f8 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -0,0 +1,194 @@ +# Desenvolvimento de Aplicações + +Não existem regras rígidas e rápidas para o desenvolvimento das aplicações com o "Wails”, mas existem algumas orientações básicas. + +## Configurar Aplicação + +O padrão usado pelos templates padrão é que `main.go` é usado para configurar e executar a aplicação, enquanto `app.go` é usado para definir a lógica da aplicação. + +O arquivo `app.go` definirá uma struct que tem 2 métodos que funcionam como hooks na aplicação principal: + +```go title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} +``` + +- O método `startup` é chamado assim que as Wails alocam os recursos de que precisa e é um bom lugar para a criação de recursos configurando ouvintes de eventos e qualquer outra coisa que o aplicativo precise na inicialização. É dado a ele um `context.Context` que é geralmente salvo em um campo struct. Este contexto é necessário para chamar o [runtime](../reference/runtime/intro.mdx). Se este método retornar um erro, o aplicativo será encerrado. No modo de desenvolvimento, o erro será exibido no console. + +- O método de `shutdown` será chamado pelo Wails logo no final do processo de encerramento. Este é um bom lugar para limpar memória e executar qualquer tarefa encerrada. + +O arquivo `main.go` geralmente consiste de uma única chamada para `wails.Run()`, que aceita a configuração da aplicação. O padrão usado pelos templates é o antes da chamada para `wails.Run()`, uma instância do struct definido no aplicativo `app. o` é criado e salvo em uma variável chamada `app`. Essa configuração é onde adicionamos os nossos callbacks: + +```go {3,9,10} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +Mais informações sobre os hooks do ciclo de vida da aplicação podem ser encontradas [aqui](../howdoesitwork.mdx#application-lifecycle-callbacks). + +## Métodos de vínculo + +É provável que você queira chamar métodos Go do frontend. Isso normalmente é feito adicionando métodos públicos ao a struct já definida no `app.go`: + +```go {16-18} title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +Na configuração principal do aplicativo, a tecla `Bind` é onde podemos dizer aos Wails o que queremos vincular: + +```go {11-13} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +Isso vinculará todos os métodos públicos em nosso `App` de construção (isso nunca vinculará os métodos de inicialização e desligação). + +### Lidando com contexto quando vincular várias structs + +Se você quiser vincular métodos para várias structs , mas deseja que cada structs mantenha uma referência ao contexto para que você possa usar as funções de tempo de execução, um bom padrão é passar o contexto do método `OnStartup` para suas instâncias de construção : + +```go +func main() { + + app := NewApp() + otherStruct := NewOtherStruct() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: func(ctx context.Context){ + app.SetContext(ctx) + otherStruct.SetContext(ctx) + }, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + otherStruct + }, + }) + if err != nil { + log.Fatal(err) + } +} +``` + +Mais informações sobre isso podem ser encontradas [aqui](../howdoesitwork.mdx#method-binding). + +## Menu da aplicação + +O Wails suporta adicionar um menu à sua aplicação. Isso é feito passando uma [struct](../reference/menus.mdx#menu) de menu para a configuração da aplicação. É comum o uso de um método que retorna um Menu, e ainda mais comum que seja um método na struct `App` usada para hooks de ciclo de vida. + +```go {11} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Menu: app.menu(), + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +## Assets + +A grande coisa do jeito que o Wails v2 lida com assets é que não o faz! A única coisa que você precisa fazer no Wails é um `embed.FS`. A forma como se chega a isso depende inteiramente de você. Você pode usar arquivos html/css/js como o modelo vanilla. Você pode ter um sistema de compilação complicado, isso não importa. + +Quando `wails build` é executado, ele vai verificar o arquivo do projeto `wails.json` na raiz do projeto. Há duas chaves no arquivo do projeto que são lidas: + +- "frontend:install" +- "frontend:build" + +O primeiro, se dado, será executado no diretório `frontend` para instalar os módulos do Node. O segundo, se dado, será executado no diretório `frontend` para realizar o build do projeto frontend. + +Se essas duas chaves não são dadas, então as Wails não faz absolutamente nada com a frontend. É apenas esperando o `embed.FS`. + +### AssetsHandler + +Um aplicativo Wails v2 pode opcionalmente definir um `http.Handler` nas opções `options.App`, que permite o gancho do AssetServer criar arquivos em tempo real ou processe solicitações POST/PUT. Solicitações GET sempre são tratadas primeiramente pelos `assets` FS. Se o FS não encontrar o arquivo solicitado, a solicitação será encaminhada para `http.Handler` para servir. Qualquer requisição que não seja o GET será diretamente processada pelo `AssetsHandler` se especificado. Também é usar apenas o `AssetsHandler` por especificação é `nil` como a opção `Assets`. + +## Servidor de Desenvolvedor nativo + +Executar `wails dev` iniciará o servidor de desenvolvimento que também iniciará um observador de arquivos no seu diretório de projeto. Por padrão, se qualquer arquivo for alterado, verifica-se se era um arquivo da aplicação (padrão: `.go`, configurável com `-e` flag). Se foi, então ele irá reconstruir sua aplicação e reiniciá-la. Se o arquivo alterado estiver nos assets, emitirá uma recarga após um curto período de tempo. + +O servidor de desenvolvimento utiliza uma técnica chamada "debwaring" que significa que não recarrega imediatamente, como pode haver vários arquivos alterados em um curto período de tempo. Quando um gatilho ocorre, ele espera por uma quantidade de tempo definida antes de emitir um recarregamento. Se outro gatilho acontecer, ele será redefinido para esperar novamente. Por padrão, esse valor é de `100ms`. Se este valor não funcionar para o seu projeto, ele pode ser configurado usando a flag `-debounce`. Se usado, este valor será salvo na configuração do seu projeto e se tornará o padrão. + +## 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. + +## Go Module + +Os modelos padrão do Wails geram um arquivo `go.mod` que contém o nome do módulo "changeme". Você deve alterar isto para algo mais apropriado após a geração do projeto. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx new file mode 100644 index 00000000..73173e15 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx @@ -0,0 +1,136 @@ +# Dynamic Assets + +If you want to load or generate assets for your frontend dynamically, you can achieve that using the [AssetsHandler](../reference/options#assetshandler) option. The AssetsHandler is a generic `http.Handler` which will be called for any non GET request on the assets server and for GET requests which can not be served from the bundled assets because the file is not found. + +By installing a custom AssetsHandler, you can serve your own assets using a custom asset server. + +## Example + +In our example project, we will create a simple assets handler which will load files off disk: + +```go title=main.go {16-35,49} +package main + +import ( + "embed" + "fmt" + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "net/http" + "os" + "strings" +) + +//go:embed all:frontend/dist +var assets embed.FS + +type FileLoader struct { + http.Handler +} + +func NewFileLoader() *FileLoader { + return &FileLoader{} +} + +func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request) { + var err error + requestedFilename := strings.TrimPrefix(req.URL.Path, "/") + println("Requesting file:", requestedFilename) + fileData, err := os.ReadFile(requestedFilename) + if err != nil { + res.WriteHeader(http.StatusBadRequest) + res.Write([]byte(fmt.Sprintf("Could not load file %s", requestedFilename))) + } + + res.Write(fileData) +} + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "helloworld", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: NewFileLoader(), + }, + BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 255}, + OnStartup: app.startup, + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +When we run the application in dev mode using `wails dev`, we will see the following output: + +``` +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' failed, using AssetHandler +Requesting file: favicon.ico +``` + +As you can see, the assets handler is called when the default assets server is unable to serve the `favicon.ico` file. + +If you right click the main application and select "inspect" to bring up the devtools, you can test this feature out by typing the following into the console: + +``` +let response = await fetch('does-not-exist.txt'); +``` + +This will generate an error in the devtools. We can see that the error is what we expect, returned by our custom assets handler: + +```mdx-code-block +

+ +

+``` + +However, if we request `go.mod`, we will see the following output: + +```mdx-code-block +

+ +

+``` + +This technique can be used to load images directly into the page. If we updated our default vanilla template and replaced the logo image: + +```html + +``` + +with: + +```html + +``` + +Then we would see the following: + +```mdx-code-block +

+ +

+``` + +:::warning + +Exposing your filesystem in this way is a security risk. It is recommended that you properly manage access to your filesystem. + +::: diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frameless.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frameless.mdx new file mode 100644 index 00000000..3845736f --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frameless.mdx @@ -0,0 +1,87 @@ +# Frameless Applications + +Wails supports application that have no frames. This can be achieved by using the [frameless](../reference/options.mdx#frameless) field in [Application Options](../reference/options.mdx#application-options). + +Wails offers a simple solution for dragging the window: Any HTML element that has the CSS style `--wails-draggable:drag` will act as a "drag handle". This property applies to all child elements. If you need to indicate that a nested element should not drag, then use the attribute '--wails-draggable:no-drag' on that element. + +```html + + + + + + + +
+ + +
+
+ + + + +``` + +For some projects, using a CSS variable may not be possible due to dynamic styling. In this case, you can use the `CSSDragProperty` and `CSSDragValue` application options to define a property and value that will be used to indicate draggable regions: + +```go title=main.go +package main + +import ( + "embed" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "alwaysontop", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Frameless: true, + CSSDragProperty: "widows", + CSSDragValue: "1", + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +```html title=index.html + + + + + + alwaysontop + + +
+ + + +``` + +:::info Fullscreen + +If you allow your application to go fullscreen, this drag functionality will be disabled. + +::: diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frontend.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frontend.mdx new file mode 100644 index 00000000..aade2b7f --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/frontend.mdx @@ -0,0 +1,72 @@ +# Frontend + +## Injeção de script + +Quando Wails serve a página `index.html`, por padrão injetará duas entradas de escript na ``tag para carregar `/wails/ipc.js` e `/wails/runtime.js`. Esses arquivos instalam o bindings e o tempo de execução, respectivamente. + +O código abaixo mostra onde estas são injetadas por padrão: + +```html + + + injection example + + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + +``` + +### Sobrescrevendo a injeção de script padrão + +Para oferecer mais flexibilidade aos desenvolvedores, há uma meta tag que pode ser usada para personalizar este comportamento: + +```html + +``` + +As configurações são as seguintes: + +| Valor | Descrição | +| ------------------- | ---------------------------------------------- | +| noautoinjectruntime | Desativa a auto-injeção no `/wails/runtime.js` | +| noautoinjectipc | Desativa a autoinjeção no `/wails/ipc.js` | +| noautoinject | Desativa todas as autoinjeções de scripts | + +Várias opções podem ser usadas, desde que sejam separadas por vírgulas. + +Este código é perfeitamente válido e opera o mesmo que a versão da auto-injeção: + +```html + + + injection example + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + + + +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/ides.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/ides.mdx new file mode 100644 index 00000000..fdb83a6a --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/ides.mdx @@ -0,0 +1,127 @@ +# IDEs + +O Wails pretende proporcionar uma grande experiência de desenvolvimento. Para atingir isso, agora suportamos a geração de configuração específica de IDE para fornecer uma configuração de projeto mais suave. + +Atualmente, nós suportamos o [Visual Studio Code](https://code.visualstudio.com/) mas buscamos oferecer suporte a outros IDEs, como o Goland. + +## Visual Studio Code + +```mdx-code-block +

+ +

+``` + +Ao gerar um projeto usando a `-ide vscode` flag, arquivos IDE serão criados juntamente com os outros arquivos do projeto. Estes arquivos são colocados no diretório `.vscode` e fornecem a configuração correta para depurar seu aplicativo. + +Os 2 arquivos gerados são `tasks.json` e `launch.json`. Abaixo estão os arquivos gerados para o projeto vanilla padrão: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/myproject.exe" + ] + } + ] +} +``` + +```json title="launch.json" +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Wails: Debug myproject", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/build/bin/myproject.exe", + "preLaunchTask": "build", + "cwd": "${workspaceFolder}", + "env": {} + } + ] +} +``` + +### Configurando os passos de instalação e compilação + +O arquivo `tasks.json` é simples para o projeto padrão, já que não há nenhuma etapa de instalação em que `npm` ou `npm run build` seja necessário. Para projetos que tenham uma etapa de build de front-end, como o modelo do Svelte, precisaríamos editar `tasks.json` e adicionar os passos de instalação e compilação: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "npm install", + "type": "npm", + "script": "install", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "npm run build", + "type": "npm", + "script": "build", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/vscode.exe" + ], + "dependsOn": ["npm install", "npm run build"] + } + ] +} +``` + +:::info Melhoria Futura + +No futuro, esperamos gerar um `tasks.json` que inclui os passos de instalação e compilação automaticamente. + +::: diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx new file mode 100644 index 00000000..0241bdb5 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx @@ -0,0 +1,103 @@ +# Suporte a Distros Linux + +## Visão geral + +O Wails oferece suporte Linux, mas fornecer instruções de instalação para todas as distribuições disponíveis é uma tarefa impossível. Em vez disso, a Wails tenta determinar se os pacotes que você precisa para desenvolver aplicações estão disponíveis através do gerenciador de pacote do seu sistema. Atualmente, suportamos os seguintes gestores de pacotes: + +- apt +- dnf +- emerge +- eopkg +- nixpkgs +- pacman +- zypper + +## Adicionando nomes de pacotes + +Pode haver circunstâncias em que sua distro use um dos gerentes de pacote suportados, mas o nome do pacote é diferente. Por exemplo, você pode usar um derivado de Ubuntu, mas o nome do pacote para gtk pode ser diferente. Wails tenta encontrar o pacote correto iterando por meio de uma lista de nomes de pacotes. A lista de pacotes é armazenada no arquivo específico do gerenciador de pacotes no diretório `v2/internal/system/packagemanager`. No nosso exemplo, isso seria `v2/internal/system/packagemanager/apt.go`. + +Neste arquivo, a lista de pacotes são definidos pelo método `Packages()`: + +```go +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +Vamos supor que na nossa distração em linux, a `libgtk-3` é empacotada com o nome `lib-gtk3-dev`. Podemos adicionar suporte para isso adicionando a seguinte linha: + +```go {5} +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + {Name: "lib-gtk3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +## Adicionando novos gerenciadores de pacotes + +Para adicionar um novo gerenciador de pacotes, execute os seguintes passos: + +- Crie um novo arquivo em `v2/internal/system/packagemanager` chamado `.go`, onde `` é o nome do gerenciador de pacote. +- Defina uma struct que esteja em conformidade com a interface de gerenciador de pacotes definida em `pm.go`: + +```go +type PackageManager interface { + Name() string + Packages() packagemap + PackageInstalled(*Package) (bool, error) + PackageAvailable(*Package) (bool, error) + InstallCommand(*Package) string +} +``` + +- `Name()` deve retornar o nome do gerenciador de pacotes +- `Packages()` deve retornar um `packagemap`, que fornece nomes de arquivo de candidatos para dependências +- `PackageInstalled()` deve retornar `true` se o pacote for instalado +- `PackageAvailable()` deve retornar `true` se o pacote fornecido não estiver instalado, mas disponível para instalação +- `InstallCommand()` deve retornar o comando exato para instalar o nome do pacote dado + +Dê uma olhada no código de outros gerenciadores de pacotes para ter uma ideia de como isto funciona. + +:::info Lembre-se + +Se você adicionar suporte para um novo gerenciador de pacotes, não se esqueça de também atualizar esta página! + +::: diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux.mdx new file mode 100644 index 00000000..a975968f --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/linux.mdx @@ -0,0 +1,18 @@ +# Linux + +Esta página possui vários guias relacionados ao desenvolvimento de aplicativos Wails para Linux. + +## A tag de vídeo não ativa o evento "ended" + +Ao usar uma tag de vídeo, o evento "ended" não é acionado quando o vídeo terminar de ser reproduzido. Este é um erro no WebkitGTK, no entanto, você pode usar a seguinte solução alternativa para corrigi-lo: + +```js +videoTag.addEventListener("timeupdate", (event) => { + if (event.target.duration - event.target.currentTime < 0.2) { + let ended = new Event("ended"); + event.target.dispatchEvent(ended); + } +}); +``` + +Fonte: [Lyimmi](https://github.com/Lyimmi) no [fórum de discussões](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275) diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/local-development.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/local-development.mdx new file mode 100644 index 00000000..9532fe78 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/local-development.mdx @@ -0,0 +1,55 @@ +# Local Development + +## Visão geral + +Wails is in constant development and new releases are regularly "tagged". This usually happens when all the newer code on `master` has been tested and confirmed working. If you need a bugfix or feature that has not yet made it to a release, it's possible to use the latest "bleeding edge" version using the following steps: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails/v2/cmd/wails` +- `go install` + +NOTE: The directory that you cloned the project into will now be called "clonedir". + +The Wails CLI will now be at the very latest version. + +### Updating your project + +To update projects to use the latest version of the Wails library, update the project's `go.mod` and ensure the following line is at the bottom of the file: + +`replace github.com/wailsapp/wails/v2 => ` + +Example: + +On Windows: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2` + +On 'nix: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2` + +To revert to a stable version, run: + +`go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +## Testing a Branch + +If you want to test a branch, follow the instructions above, but ensure you switch the branch you want to test before installing: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git checkout -b branch-to-test --track origin/branch-to-test` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. + +## Testing a PR + +If you want to test a PR, follow the instructions above, but ensure you fetch the PR and switch the branch before installing. Please replace `[IDofThePR]` with the ID of the PR shown on github.com: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git fetch -u origin pull/[IDofThePR]/head:test/pr-[IDofThePR]` +- `git checkout test/pr-[IDofThePR]` +- `git reset --hard HEAD` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx new file mode 100644 index 00000000..f3142438 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx @@ -0,0 +1,95 @@ +# Compilações manuais + +O CLI Wails faz um trabalho pesado pelo projeto, mas às vezes é desejável construir o seu projeto manualmente. Este documento discutirá as diferentes operações da CLI e a forma como isso pode ser conseguido de diferentes maneiras. + +## Processo de compilação + +Quando `wails build` ou `wails dev` são usados, o Wails CLI executa um processo de compilação comum: + + - Instalar dependências frontend + - Construir projeto frontend + - Gerar mídias de construção + - Compilar aplicação + - [optional] Comprimir o aplicativo + +### Instalar dependências frontend + +#### Passos CLI + +- Se a flag `-s` for dada, esta etapa é ignorada +- Verifica `wails.json` para ver se há um comando de instalação na chave `frontend:install` +- Se não houver, ela pula esta etapa +- Se houver, ele verifica se `package.json` existe no diretório do frontend. Se não existir, pula esta etapa +- Uma soma MD5 é gerada a partir do conteúdo do arquivo `package.json` +- Verifica a existência de `package.json.md5` e, se existir, irá comparar o conteúdo dele (uma soma MD5) com o gerado para ver se o conteúdo mudou. Se eles forem iguais, este passo é ignorado +- Se `package.json.md5` não existir, será criado usando a soma MD5 gerada +- Se uma compilação é necessária agora, ou a `node_modules` não existe, ou a flag `-f` é dada, o comando de instalação é executado no diretório frontend + +#### Passos manuais + +Esta etapa pode ser feita na linha de comando ou um script com o `npm install`. + +### Construir projeto frontend + +#### Wails CLI + +- Se a flag `-s` for dada, esta etapa é ignorada +- Verifica `wails.json` para ver se há um comando de compilação na chave `frontend:build` +- Se não houver, ela pula esta etapa +- Se houver, ele é executado no diretório frontend + +#### Passos manuais + +Esta etapa poderia ser feita a partir da linha de comando ou um script com `npm run build` ou qualquer que seja o script de compilação do frontend. + +### Gerar mídias + +#### Wails CLI + +- Se a flag `-nopackage` estiver definida, este estágio será ignorado +- Se o arquivo `build/appicon.png` não existir, um arquivo padrão será criado +- Para Windows, consulte [Conjuntos para Windows](#windows) +- Se `build/windows/icon.ico` não existir, ele será criado a partir da imagem `build/appicon.png`. + +##### Windows + +- Se `build/windows/icon.ico` não existir, irá criá-lo a partir de `build/appicon. ng` usando tamanhos de ícones de 256, 128, 64, 48, 32 e 16. Isso é feito usando o [winicon](https://github.com/leaanthony/winicon). +- Se o arquivo `build/windows/.manifest` não existir, será criado a partir de uma versão padrão. +- Compila a aplicação como uma compilação de produção (acima) +- Usa [winres](https://github.com/tc-hib/winres) para empacotar o ícone e manifestar em um arquivo `.syso` pronto para vincular. + +#### Passos manuais + +- Crie `icon.ico` usando o [winicon](https://github.com/leaanthony/winicon) Ferramenta de CLI (ou qualquer outra ferramenta). +- Criar / Atualizar o arquivo de `.manifest` para sua aplicação +- Use o [winres CLI](https://github.com/tc-hib/go-winres) para gerar um arquivo `.syso`. + +### Compilar aplicação + +#### Wails CLI + +- Se o sinalizador `-clean` for fornecido, o diretório `build` é excluído e recriado +- Para `wails dev`, as seguintes bandeiras Go padrão são usadas: `-tags dev -gcflags "all=-N -l"` +- Para `wails build`, as seguintes flags padrão do Go são usadas: `-tags desktop,production -ldflags "-w -s"` + - No Windows, `-ldflags "-w -h -H windowsgui"` +- Tags adicionais passadas para o CLI usando `-tags` são adicionadas aos padrões +- Ldflags adicionais passadas para a CLI usando `-ldflags` são adicionados aos padrões +- A bandeira `-o` é passada +- O compilador Go especificado por `-compiler` será usado para compilação + +#### Passos manuais + +- Para compilação de desenvolvedores, o comando mínimo seria: `go build -tags dev -gcflags "all=-N -l"` +- Para a compilação de produção, o comando mínimo seria: `go build -tags desktop,production -ldflags "-w -s -H windowsgui"` +- Certifique-se de compilar no mesmo diretório que o arquivo `.syso` + +### Comprimir aplicativo + +#### Wails CLI + +- Se a flag `-upx` tiver sido dada, o programa `upx` será executado para comprimir o aplicativo com as configurações padrão +- Se `-upxflags` também for colado, essas flags são usadas em vez das padrão + +#### Passos manuais + +- Execute `upx [flags]` manualmente para comprimir o aplicativo. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/migrating.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/migrating.mdx new file mode 100644 index 00000000..b985e2a6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/migrating.mdx @@ -0,0 +1,191 @@ +# Migrating from v1 + +## Visão geral + +Wails v2 is a significant change from v1. This document aims to highlight the changes and the steps in migrating an existing project. + +### Creating the Application + +In v1, the main application is created using `wails.CreateApp`, bindings are added with `app.Bind`, then the application is run using `app.Run()`. + +Example: + +```go title="v1" + app := wails.CreateApp(&wails.AppConfig{ + Title: "MyApp", + Width: 1024, + Height: 768, + JS: js, + CSS: css, + Colour: "#131313", + }) + app.Bind(basic) + app.Run() +``` + +In v2, there is just a single method, `wails.Run()`, that accepts [application options](../reference/options.mdx#application-options). + +```go title="v2" + err := wails.Run(&options.App{ + Title: "MyApp", + Width: 800, + Height: 600, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + basic, + }, + }) +``` + +### Binding + +In v1, it was possible to bind both arbitrary functions and structs. In v2, this has been simplified to only binding structs. The struct instances that were previously passed to the `Bind()` method in v1, are now specified in the `Bind` field of the [application options](../reference/options.mdx#application-options): + +```go title="v1" + app := wails.CreateApp(/* options */) + app.Bind(basic) +``` + +```go title="v2" + err := wails.Run(&options.App{ + /* other options */ + Bind: []interface{}{ + basic, + }, + }) +``` + +In v1, bound methods were available to the frontend at `window.backend`. This has changed to `window.go`.`` + +### Application Lifecycle + +In v1, there were 2 special methods in a bound struct: `WailsInit()` and `WailsShutdown()`. These have been replaced with 3 lifecycle hooks as part of the [application options](../reference/options.mdx#application-options): + +- [OnStartup](../reference/options.mdx#onstartup) +- [OnShutdown](../reference/options.mdx#onshutdown) +- [OnDomReady](../reference/options.mdx#ondomready) + +Note: [OnDomReady](../reference/options.mdx#ondomready) replaces the `wails:ready` system event in v1. + +These methods can be standard functions, but a common practice is to have them part of a struct: + +```go title="v2" + basic := NewBasicApp() + err := wails.Run(&options.App{ + /* Other Options */ + OnStartup: basic.startup, + OnShutdown: basic.shutdown, + OnDomReady: basic.domready, + }) +... +type Basic struct { + ctx context.Context +} +func (b *Basic) startup(ctx context.Context) { + b.ctx = ctx +} +... +``` + +### Runtime + +The runtime in v2 is much richer than v1 with support for menus, window manipulation and better dialogs. The signature of the methods has changed slightly - please refer the the [Runtime Reference](../reference/runtime/intro.mdx). + +In v1, the [runtime](../reference/runtime/intro.mdx) was available via a struct passed to `WailsInit()`. In v2, the runtime has been moved out to its own package. Each method in the runtime takes the `context.Context` that is passed to the [OnStartup](../reference/options.mdx#onstartup) method. + +```go title="Runtime Example" +package main + +import "github.com/wailsapp/wails/v2/pkg/runtime" + +type Basic struct { + ctx context.Context +} + +// startup is called at application startup +func (a *App) startup(ctx context.Context) { + a.ctx = ctx + runtime.LogInfo(ctx, "Application Startup called!") +} + +``` + +### Assets + +The _biggest_ change in v2 is how assets are handled. + +In v1, assets were passed via 2 application options: + +- `JS` - The application's Javascript +- `CSS` - The application's CSS + +This meant that the responsibility of generating a single JS and CSS file was on the developer. This essentially required the use of complicated packers such as webpack. + +In v2, Wails makes no assumptions about your frontend assets, just like a webserver. All of your application assets are passed to the application options as an `embed.FS`. + +**This means there is no requirement to bundle your assets, encode images as Base64 or attempt the dark art of bundler configuration to use custom fonts**. + +At startup, Wails will scan the given `embed.FS` for `index.html` and use its location as the root path for all the other application assets - just like a webserver would. + +Example: An application has the following project layout. All final assets are placed in the `frontend/dist` directory: + +```shell +. +├── build/ +├── frontend/ +│ └── dist/ +│ ├── index.html +│ ├── main.js +│ ├── main.css +│ └── logo.svg +├── main.go +└── wails.json +``` + +Those assets may be used by the application by simply creating an `embed.FS`: + +```go title="Assets Example" +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + err := wails.Run(&options.App{ + /* Other Options */ + AssetServer: &assetserver.Options{ + Assets: assets, + }, + }) +} +``` + +Of course, bundlers can be used if you wish to. The only requirement is to pass the final application assets directory to Wails using an `embed.FS` in the `Assets` key of the [application options](../reference/options.mdx#application-options). + +### Project Configuration + +In v1, the project configuration was stored in the `project.json` file in the project root. In v2, the project configuration is stored in the `wails.json` file in the project root. + +The format of the file is slightly different. Here is a comparison: + +

+ +| v1 | v2 | Notes | +| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | name | | +| description | | Removed | +| author / name | author / name | | +| author / email | author / email | | +| version | version | | +| binaryname | outputfilename | Changed | +| frontend / dir | | Removed | +| frontend / install | frontend:install | Changed | +| frontend / build | frontend:build | Changed | +| frontend / bridge | | Removed | +| frontend / serve | | Removed | +| tags | | Removed | +| | wailsjsdir | The directory to generate wailsjs modules | +| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. | +| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. This is only needed for some more advanced asset configurations. | + +

diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx new file mode 100644 index 00000000..4a3de2a6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx @@ -0,0 +1,25 @@ +# Mouse Buttons + +The Wails runtime intercepts mouse clicks to determine whether a frameless window needs resizing or a window needs to be moved. It has been asked how to detect when a mouse click has occurred, because `window.onclick` doesn't report the mouse buttons correctly. The following code shows how to detect mouse clicks: + +```javascript +window.addEventListener("mousedown", handleMouseButtonDown); + +function handleMouseButtonDown(event) { + if (event.button === 0) { + // left mouse button + } else if (event.button === 1) { + // middle mouse button + } else if (event.button === 2) { + // right mouse button + } else if (event.button === 3) { + // back mouse button + } else if (event.button === 4) { + // forward mouse button + } else { + // other mouse button + } +} +``` + +Reference: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx new file mode 100644 index 00000000..21f7875e --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx @@ -0,0 +1,40 @@ +# Obfuscated Builds + +Wails includes support for obfuscating your application using [garble](https://github.com/burrowers/garble). + +To produce an obfuscated build, you can use the `-obfuscate` flag with the `wails build` command: + +```bash +wails build -obfuscated +``` + +To customise the obfuscation settings, you can use the `-garbleargs` flag: + +```bash +wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed" +``` + +These settings may be persisted in your [project config](../reference/project-config). + +## How it works + +In a standard build, all bound methods are available in the frontend under the `window.go` variable. When these methods are called, the corresponding backend method is called using the fully qualified function name. When using an obfuscated build, methods are bound using an ID instead of a name. The bindings generated in the `wailsjs` directory use these IDs to call the backend functions. + +:::note + +To ensure that your application will work in obfuscated mode, you must use the generated bindings under the `wailsjs` directory in your application. + +::: + +## Example + +Importing the "Greet" method from the bindings like this: + +```js +import { Greet } from "../../wailsjs/go/main/App"; + +// snip +Greet("World"); +``` + +will ensure that the method will work correctly in obfuscated mode, as the bindings will be regenerated with IDs and the call mechanism updated. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/overscroll.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/overscroll.mdx new file mode 100644 index 00000000..9d1d772d --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/overscroll.mdx @@ -0,0 +1,10 @@ +# Overscroll + +[Overscroll](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) is the "bounce effect" you sometimes get when you scroll beyond a page's content boundaries. This is common in mobile apps. This can be disabled using CSS: + +```css +html { + height: 100%; + overflow: hidden; +} +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx new file mode 100644 index 00000000..54e7073d --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/routing.mdx @@ -0,0 +1,47 @@ +# Roteamento + +O roteamento é uma maneira popular de alternar as telas de um aplicativo. Esta página oferece algumas orientações sobre como fazer isso. + +## Vue + +A abordagem recomendada para roteamento em Vue é o [Hash Mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode): + +```js +import { createRouter, createWebHashHistory } from "vue-router"; + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + //... + ], +}); +``` + +## Angular + +A abordagem recomendada para roteamento em Angular é [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy): + +```ts +RouterModule.forRoot(routes, { useHash: true }); +``` + +## React + +A abordagem recomendada para roteamento em React é [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router): + +```jsx +import { HashRouter } from "react-router-dom"; + +ReactDOM.render( + + {/* The rest of your app goes here */} + + } exact /> + } /> + } /> + {/* more... */} + + , + root +); +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/signing.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/signing.mdx new file mode 100644 index 00000000..c3e0c269 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/signing.mdx @@ -0,0 +1,387 @@ +# Assinatura de Código + +Este é um guia sobre como você pode assinar seus binários gerados com Wails no MacOS e Windows. O guia visará ambientes de CI, mais especificamente as GitHub Actions. + +## Windows + +Primeiro você precisa de um certificado de assinatura de código. Se você ainda não tiver uma, a página de informações da Microsoft lista alguns provedores [aqui](https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate). Observe que um certificado EV não é necessário a menos que você precise escrever um software no nível kernel como drivers de dispositivos. Para assinar o seu aplicativo Wails, um certificado de assinatura de código padrão vai dar certo. + +Pode ser uma boa ideia verificar com seu provedor de certificados como assinar seus binários na sua máquina local antes de direcionar sistemas de compilação automatizada. só para que você saiba se há exigências especiais. Por exemplo, [aqui](https://www.ssl.com/how-to/using-your-code-signing-certificate/) é o guia de assinatura de código de SSL.com para Windows. Se você sabe como assinar localmente, será mais fácil solucionar quaisquer possíveis problemas em um ambiente de CI. Por exemplo, os certificados de assinatura de código SSL.com exigem a flag `/tr` para [SignTool.exe](https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool) enquanto outros provedores só precisam da flag `/t` para fornecer o servidor de marcação de tempo. GitHub Actions populares para assinar binários Windows como [este](https://github.com/Dana-Prajea/code-sign-action) não suporta a flag `/tr` no SignTool.exe. Portanto, este guia focará em assinar nosso aplicativo manualmente com comandos do PowerShell, mas você pode usar ações como a ação de [de co-sign-action](https://github.com/Dana-Prajea/code-sign-action) se preferir. + +Em primeiro lugar, vamos nos certificar de que somos capazes de construir nosso aplicativo Wails no nosso GitHub CI. Aqui está um pequeno modelo de fluxo de trabalho: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend manually here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +Em seguida, precisamos dar ao fluxo de trabalho do GitHub acesso ao nosso certificado de assinatura. Isso é feito codificando seu certificado .pfx ou .p12 em uma string base64. Para fazer isso em PowerShell, use o seguinte comando assumindo que seu certificado se chama 'my-cert.p12': + +```PowerShell +certutil -encode .\my-cert.p12 my-cert-base64.txt +``` + +Você deve ter seu arquivo .txt com o certificado codificado em base64. Deve começar com _-----BEGIN CERTIFICATE-----_ e terminar com _-----END CERTIFICATE-----_. Agora você precisa criar duas ações secretas no GitHub. Navegue até _Configurações -> Segredos -> Ações_ e crie os dois seguintes segredos: + +- **WIN_SIGNING_CERT** com o conteúdo de seu texto codificado no certificado base64. +- **WIN_SIGNING_CERT_PASSWORD** com o conteúdo da sua senha do certificado. + +Agora estamos prontos para implementar a assinatura em nosso fluxo de trabalho usando um dos dois métodos: + +### Método 1: Assinar com comandos + +Esse método usa comandos PowerShell para assinar nosso aplicativo, e deixa o controle de todo o processo de assinatura. + +Após o passo `Build Wails app`, podemos adicionar o seguinte passo ao nosso fluxo de trabalho: + +```yaml +- name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd /t /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' + +``` + +Este script cria um novo diretório para o seu arquivo de certificado, cria o arquivo de certificado do nosso segredo base64, converte-o em um arquivo .pfx, e finalmente assina o binário. As seguintes variáveis precisam ser substituídas na última linha: + +- **signing algorithm**: geralmente sha256. +- **timestamping server**: URL para o servidor de timestamping a ser usado com seu certificado. +- **path to binary**: caminho para o binário que você deseja assinar. + +Dado que nossa configuração Wails tem `outputfilename` definido para "app.exe" e que temos um certificado de SSL.com, este é o nosso fluxo de trabalho: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\app.exe + + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +### Método 2: assinar automaticamente com Action + +É possível usar um código Windows assinando uma ação como [este](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate) um, mas nota que requer um hash SHA1 para o certificado e um nome de certificado. Veja um exemplo de como configurá-lo na [loja da ações](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate). + +--- + +## MacOS + +Primeiro você precisa do seu certificado de assinatura de código da Apple. Se você não tem uma, uma pesquisa simples do Google irá ajudá-lo a adquirir uma. Depois de ter o certificado, você precisa exportá-lo e codificá-lo para base64. [Este tutorial](https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions) te mostra como fazer isso de uma maneira fácil. Depois de ter exportado seu arquivo de certificado .p12, você pode codificá-lo para base64, como visto no tutorial com o seguinte comando: + +```bash +base64 Certificates.p12 | pbcopy +``` + +Agora você está pronto para criar alguns segredos de projeto do GitHub, assim como no Windows: + +- **APPLE_DEVELOPER_CERTIFICATE_P12_BASE64** com o conteúdo de seu certificado base64 recém-copiado. +- **APPLE_DEVELOPER_CERTIFICATE_PASSWORD** com o conteúdo da senha do seu certificado. +- **APPLE_PASSWORD** com o conteúdo de uma senha específica para sua conta Apple-ID que pode gerar [aqui](https://appleid.apple.com/account/manage). + +Vamos nos certificar de que somos capazes de construir nosso aplicativo Wails em nosso fluxo de trabalho do GitHub. Aqui está um pequeno modelo: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +Para assinar o código no macOS, [gon](https://github.com/mitchellh/gon) é uma ferramenta muito útil para a assinatura do código e a comunicação com os servidores Apple, também escrito em Go, e será usado neste guia. + +Após o passo `Build Wails app`, adicione o seguinte ao fluxo de trabalho: + +```yaml +- name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon +``` + +Agora precisamos configurar alguns arquivos de configuração do gon no nosso diretório `build/darwin`: + +1. gon-sign.json: + +```json +{ + "source": ["./build/bin/app.app"], + "bundle_id": "app.myapp", + "apple_id": { + "username": "my-appleid@email.com", + "password": "@env:APPLE_PASSWORD" + }, + "sign": { + "application_identity": "Developer ID Application: My Name" + } +} +``` + +Onde o `source` é o binário do seu Wails, `bundle_id` é o seu ID do pacote, `apple_id` contém o seu nome de usuário do ID Apple e a senha do aplicativo que você criou antes, e `sign.application_identity` é sua identidade que você pode encontrar executando o seguinte comando: + +```bash +security find-identity -v -p codesigning +``` + +2. entitlements.plist: + +```plist + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.downloads.read-write + + + +``` + +Neste arquivo, você configura os direitos que você precisa para seu aplicativo, por exemplo, permissões de câmera se seu app usa a câmera. Leia mais sobre entitlements [aqui](https://developer.apple.com/documentation/bundleresources/entitlements). + +Verifique se você atualizou seu arquivo `Info.plist` com o mesmo pacote de ID que você digitou em `gon-sign.json`. Aqui está um arquivo `Info.plis` de exemplo: + +```plist + + + CFBundlePackageTypeAPPL + CFBundleNameMyApp + CFBundleExecutableapp + CFBundleIdentifierapp.myapp + CFBundleVersion0.1.0 + CFBundleGetInfoStringMy app is cool and nice and chill and + CFBundleShortVersionString0.1.0 + CFBundleIconFileiconfile + LSMinimumSystemVersion10.13.0 + NSHighResolutionCapabletrue + LSApplicationCategoryTypepublic.app-category.utilities + NSHumanReadableCopyright© Me + +``` + +Agora estamos prontos para adicionar a etapa de assinatura em nosso fluxo de trabalho após a construção do aplicativo Wails: + +```yaml +- name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} +- name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json +``` + +Por favor, note que a assinatura de binários com Apple pode levar a de minutos a horas. + +## Arquivo de fluxo combinado: + +Aqui está nosso arquivo de fluxo de trabalho do GitHub com Windows + macOS combinados: + +```yaml +name: "example combined" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon + - name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\Monitor.exe + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +# Notas finais + +Este guia inspirado no projeto RiftShare e seu fluxo de trabalho, o que é altamente recomendado para verificar [aqui](https://github.com/achhabra2/riftshare/blob/main/.github/workflows/build.yaml). diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/templates.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/templates.mdx new file mode 100644 index 00000000..790e3107 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/templates.mdx @@ -0,0 +1,97 @@ +# Templates + +Wails generates projects from pre-created templates. In v1, this was a difficult to maintain set of projects that were subject to going out of date. In v2, to empower the community, a couple of new features have been added for templates: + +- Ability to generate projects from [Remote Templates](../reference/cli.mdx#remote-templates) +- Tooling to help create your own templates + +## Creating Templates + +To create a template, you can use the `wails generate template` command. To generate a default template, run: + +`wails generate template -name mytemplate` + +This creates the directory "mytemplate" with default files: + +```shell title=mytemplate/ +. +|-- NEXTSTEPS.md +|-- README.md +|-- app.tmpl.go +|-- frontend +| `-- dist +| |-- assets +| | |-- fonts +| | | |-- OFL.txt +| | | `-- nunito-v16-latin-regular.woff2 +| | `-- images +| | `-- logo-dark.svg +| |-- index.html +| |-- main.css +| `-- main.js +|-- go.mod.tmpl +|-- main.tmpl.go +|-- template.json +`-- wails.tmpl.json +``` + +### Template Overview + +The default template consists of the following files and directories: + +| Filename / Dir | Description | +| --------------- | -------------------------------------------- | +| NEXTSTEPS.md | Instructions on how to complete the template | +| README.md | The README published with the template | +| app.tmpl.go | `app.go` template file | +| frontend/ | The directory containing frontend assets | +| go.mod.tmpl | `go.mod` template file | +| main.tmpl.go | `main.go` template file | +| template.json | The template metadata | +| wails.tmpl.json | `wails.json` template file | + +At this point it is advisable to follow the steps in `NEXTSTEPS.md`. + +## Creating a Template from an Existing Project + +It's possible to create a template from an existing frontend project by passing the path to the project when generating the template. We will now walk through how to create a Vue 3 template: + +- Install the vue cli: `npm install -g @vue/cli` +- Create the default project: `vue create vue3-base` + - Select `Default (Vue 3) ([Vue 3] babel, eslint)` +- After the project has been generated, run: + +```shell +> wails generate template -name wails-vue3-template -frontend .\vue3-base\ +Extracting base template files... +Migrating existing project files to frontend directory... +Updating package.json data... +Renaming package.json -> package.tmpl.json... +Updating package-lock.json data... +Renaming package-lock.json -> package-lock.tmpl.json... +``` + +- The template may now be customised as specified in the `NEXTSTEPS.md` file +- Once the files are ready, it can be tested by running: `wails init -n my-vue3-project -t .\wails-vue3-template\` +- To test the new project, run: `cd my-vue3-project` then `wails build` +- Once the project has compiled, run it: `.\build\bin\my-vue3-project.exe` +- You should have a fully functioning Vue3 application: + +```mdx-code-block +
+ +
+``` + +## Publishing Templates + +Publishing a template is simply pushing the files to GitHub. The following best practice is encouraged: + +- Remove any unwanted files and directories (such as `.git`) from your frontend directory +- Ensure that `template.json` is complete, especially `helpurl` +- Push the files to GitHub +- Create a PR on the [Community Templates](../community/templates.mdx) page +- Announce the template on the [Template Announcement](https://github.com/wailsapp/wails/discussions/825) discussion board 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 new file mode 100644 index 00000000..7e7081fa --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -0,0 +1,162 @@ +# Troubleshooting + +An assortment of troubleshooting tips. + +## The `wails` command appears to be missing? + +If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. + +## My application is displaying a white/blank screen + +Check that your application includes the assets from the correct directory. In your `main.go` file, you will have something similar to the following code: + +```go +//go:embed all:frontend/dist +var assets embed.FS +``` + +Check that `frontend/dist` contains your application assets. + +### Mac + +If this happens on Mac, try adding the following to your `Info.plist`: + +```xml +NSAppTransportSecurity + + NSAllowsLocalNetworking + + +``` + +Reference: https://github.com/wailsapp/wails/issues/1504#issuecomment-1174317433 + +## Mac application not valid + +If your built application looks like this in finder: + +```mdx-code-block +

+ +

+``` + +it's likely that your application's `info.plist` is invalid. Update the file in `build/.app/Contents/info.plist` and check if the data is valid, EG check the binary name is correct. To persist the changes, copy the file back to the `build/darwin` directory. + +## Cannot call backend method from frontend with variadic arguments + +If you have a backend method defined with variadic parameters, eg: + +```go +func (a *App) TestFunc(msg string, args ...interface{}) error { + // Code +} +``` + +calling this method from the frontend like this will fail: + +```js +var msg = "Hello: "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, ...args) + .then((result) => { + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Workaround: + +```js +var msg = "Hello "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, args) + .then((result) => { + //without the 3 dots + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Credit: https://github.com/wailsapp/wails/issues/1186 + +## I'm having getting proxy errors when trying to install Wails + +If you are getting errors like this: + +``` +"https://proxy.golang.org/github.com/wailsapp/wails/cmd/wails/@v/list": dial tcp 172.217.163.49:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. +``` + +it's probably because the official Go Proxy is being blocked (Users in China have reported this). The solution is to set up the proxy manually, eg: + +``` +go env -w GO111MODULE=on +go env -w GOPROXY=https://goproxy.cn,direct +``` + +Source: https://github.com/wailsapp/wails/issues/1233 + +## The generated Typescript doesn't have the correct types + +Sometimes the generated Typescript doesn't have the correct types. To mitigate this, it is possible to specify what types should be generated using the `ts_type` struct tag. For more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types). + +## When I navigate away from `index.html`, I am unable to call methods on the frontend + +If you navigate away from `index.html` to a new html file, the context will be lost. This can be fixed by adding the following imports to the `` section of any new page you navigate to: + +```html + + + + +``` + +Source: https://github.com/wailsapp/wails/discussions/1512 + +## I get `too many open files` errors on my Mac when I run `wails dev` + +By default, macOS will only allow you to open a maximum of 256 files. This can affect the `wails dev` command. This limit can be increased by running: `ulimit -n 1024` in the terminal. + +FSNotify is [looking to move to Apple's fsevents](https://github.com/fsnotify/fsnotify/issues/11) for Mac. If this isn't completed soon, we will create our own implementation, tracked [here](https://github.com/wailsapp/wails/issues/1733). + +## My Mac app gives me weird compilation errors + +A few users have reported seeing compilation errors such as the following: + +```shell +# github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin +In file included from ../../pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.44.2/internal/frontend/desktop/darwin/callbacks.go:9: +In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12: +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString +- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); + ~~~~~~~~~~~~~~ ^ ~ +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT' + #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A))) +``` + +This is _normally_ due to a mismatch with the OS version you are running and the version of the XCode Command Line Tools installed. If you see an error like this, try upgrading your XCode Command Line Tools to the latest version. + +If reinstalling Xcode Command Tools still fails, you can check the path where the toolkit is located using: + +`xcode-select -p` + +If `/Applications/Xcode.app/Contents/Developer` is displayed, run `sudo xcode-select --switch /Library/Developer/CommandLineTools` + +Sources: https://github.com/wailsapp/wails/issues/1806 and https://github.com/wailsapp/wails/issues/1140#issuecomment-1290446496 + +-- + +## Cannot start service: Host version "x.x.x does not match binary version "x.x.x" + +It's preferable to add `frontend/node_modules` and `frontend/package-lock.json` to your `.gitignore`. Otherwise when opening your repository on another machine that may have different versions of Node installed, you may not be able to run your application. + +If this does happen, simply delete `frontend/node_modules` and `frontend/package-lock.json` and run your `wails build` or `wails dev` command again. \ No newline at end of file diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/vscode.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/vscode.mdx new file mode 100644 index 00000000..03962a21 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/vscode.mdx @@ -0,0 +1,82 @@ + +# Visual Studio Code + +Esta página é para dicas e truques diversos ao usar o Visual Studio Code com Wails. + +## Configuração do Vetur + +Muito obrigado [@Lyimmi](https://github.com/Lyimmi) por esta dica. Originalmente publicada [aqui](https://github.com/wailsapp/wails/issues/1791#issuecomment-1228158349). + +Vetur é um popular plugin para o Visual Studio Code que fornece realce de sintaxe e conclusão de código para projetos Vue. Ao carregar um projeto Wails no VSCode, Vetur lançará um erro já que está esperando para encontrar o projeto frontend no diretório raiz. Para consertar isso, você pode fazer o seguinte: + +Crie um arquivo chamado `vetur.config.js` na raiz do projeto. + +```javascript +// vetur.config.js +/** @type {import('vls').VeturConfig} */ +module.exports = { + // **optional** default: `{}` + // override vscode settings + // Notice: It only affects the settings used by Vetur. + settings: { + "vetur.useWorkspaceDependencies": true, + "vetur.experimental.templateInterpolationService": true + }, + // **optional** default: `[{ root: './' }]` + // support monorepos + projects: [ + { + // **required** + // Where is your project? + // It is relative to `vetur.config.js`. + // root: './packages/repo1', + root: './frontend', + // **optional** default: `'package.json'` + // Where is `package.json` in the project? + // We use it to determine the version of vue. + // It is relative to root property. + package: './package.json', + // **optional** + // Where is TypeScript config file in the project? + // It is relative to root property. + tsconfig: './tsconfig.json', + // **optional** default: `'./.vscode/vetur/snippets'` + // Where is vetur custom snippets folders? + snippetFolder: './.vscode/vetur/snippets', + // **optional** default: `[]` + // Register globally Vue component glob. + // If you set it, you can get completion by that components. + // It is relative to root property. + // Notice: It won't actually do it. You need to use `require.context` or `Vue.component` + globalComponents: [ + './src/components/**/*.vue' + ] + } + ] +} +``` + +Agora, configure `frontend/tsconfig.json`: + +```javascript +{ + "compilerOptions": { + "module": "system", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "outFile": "../../built/local/tsc.js", + "allowJs": true + }, + "exclude": [ + "node_modules", + "**/*.spec.ts" + ], + "include": [ + "src/**/*", + "wailsjs/**/*.ts" + ] +} +``` +Isso deve permitir que você use Vetur como esperado. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx new file mode 100644 index 00000000..40a4256d --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx @@ -0,0 +1,58 @@ +# Instalador NSIS + +```mdx-code-block +

+ +
+

+``` + +O Wails suporta a geração de instaladores do Windows usando o [instalador do NSIS](https://nsis.sourceforge.io/). + +## Installing NSIS + +### Windows + +O instalador está disponível na página de [Download do NSIS](https://nsis.sourceforge.io/Download). + +Se você usar o gerenciador de pacotes de chocolatey, execute o seguinte script: + +``` +choco install nsis +``` + +Se você instalar o NSIS manualmente, você precisará adicionar a pasta _Bin_, que contém `makensis.exe`, e sua instalação NSIS ao seu PATH. [Aqui](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) está um bom tutorial sobre como adicionar ao PATH no Windows. + +### Linux + +O pacote `nsis` deve estar disponível através do gerenciador de pacotes da sua distribuição. + +### MacOS + +O NSIS está disponível para instalação através de homebrew: `brew install nsis`. + +## Gerando o instalador + +Quando um novo projeto é criado, o Wails gera os arquivos de configuração do NSIS em `build/windows/installer`. Os dados de configuração são lidos do `installer/info.json` e estão configurados para usar a seção de informação do projeto `wails.json`: + +```json +// ... + "Info": { + "companyName": "My Company Name", + "productName": "Wails Vite", + "productVersion": "1.0.0", + "copyright": "Copyright.........", + "comments": "Built using Wails (https://wails.io)" + }, +``` + +Para gerar um instalador para o seu aplicativo, use a flag `-nsis` com o comando `wails build`: + +``` +wails build -nsis +``` + +O instalador agora estará disponível no diretório `build/bin`. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows.mdx new file mode 100644 index 00000000..dd76db15 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/guides/windows.mdx @@ -0,0 +1,61 @@ +# Windows + +Esta página tem guias diversos relacionados ao desenvolvimento de aplicativos Wails para Windows. + +## Manipulando a dependência de runtime WebView2, + +Aplicativos de Wails feitos para Windows possuem uma exigência de tempo de execução na Microsoft [Runtime WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Windows 11 terá isto instalado por padrão, mas algumas máquinas não. O Wails oferece uma abordagem fácil para lidar com esta dependência. + +Usando a flag `-webview2` ao realizar o build, você pode decidir o que sua aplicação fará quando não for detectado um tempo de execução adequado (incluindo se o tempo de execução instalado for muito antigo). As quatro opções são: + +1. Baixar +2. Incorporar +3. Navegador +4. Erro + +### Baixar + +Esta opção irá solicitar ao usuário que nenhum tempo de execução adequado foi encontrado e, em seguida, oferecer para baixar e executar o bootstrapper oficial no site WebView2 da Microsoft. Se o usuário continuar, o bootstrapper oficial será baixado e executado. + +### Incorporar + +Esta opção incorpora o bootstrapper oficial dentro do aplicativo. Se nenhum tempo de execução adequado for encontrado, o aplicativo oferecerá para executar o bootstrapper. Isto adiciona ~150k ao tamanho do binário. + +### Navegador + +Esta opção pedirá ao usuário que nenhum tempo de execução adequado foi encontrado e, em seguida, oferecerá para abrir um navegador na página oficial WebView2, onde o bootstrapper pode ser baixado e instalado. O aplicativo irá então sair, deixando a instalação para o usuário. + +### Erro + +Se não for encontrado um tempo de execução adequado, um erro é dado ao usuário e nenhuma ação foi feita. + +## Execução da versão fixa + +Outra forma de lidar com a dependência webview2 é enviando-a você mesmo. Você pode baixar [versão fixa em tempo de execução](https://developer.microsoft.com/microsoft-edge/webview2/#download-section) e empacotar ou baixá-lo com seu aplicativo. + +Além disso, você deve especificar o caminho para a versão fixa do tempo de execução webview2 nas `windows.Options` structure ao iniciar wails. + +```go + wails.Run(&options.App{ + Windows: &windows.Options{ + WebviewBrowserPath: "", + }, + }) +``` + +Observação: Quando `WebviewBrowserPath` é especificado a estratégia `error` seráforçada em caso de exigência de versão mínima ou erros na busca do runtime. + +## Gerando outros programas + +Ao gerar outros programas, tais como scripts, você verá a janela aparecer na tela. Para ocultar a janela, você pode usar o seguinte código: + +```go +cmd := exec.Command("your_script.exe") +cmd.SysProcAttr = &syscall.SysProcAttr{ + HideWindow: true, + CreationFlags: 0x08000000, +} +cmd.Start() +``` + +Solução fornecida pelo [sithembiso](https://github.com/sithembiso) no [quadro de discussões](https://github.com/wailsapp/wails/discussions/1734#discussioncomment-3386172). diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/howdoesitwork.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/howdoesitwork.mdx new file mode 100644 index 00000000..663684ff --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/howdoesitwork.mdx @@ -0,0 +1,369 @@ +--- +sidebar_position: 20 +--- + +# How does it work? + +A Wails application is a standard Go application, with a webkit frontend. The Go part of the application consists of the application code and a runtime library that provides a number of useful operations, like controlling the application window. The frontend is a webkit window that will display the frontend assets. Also available to the frontend is a Javascript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as Javascript methods that can be called, just as if they were local Javascript methods. + +```mdx-code-block +
+ +
+``` + +## The Main Application + +### Visão geral + +The main application consists of a single call to `wails.Run()`. It accepts the application configuration which describes the size of the application window, the window title, what assets to use, etc. A basic application might look like this: + +```go title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (b *App) startup(ctx context.Context) { + b.ctx = ctx +} + +func (b *App) shutdown(ctx context.Context) {} + +func (b *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +### Options rundown + +This example has the following options set: + +- `Title` - The text that should appear in the window's title bar +- `Width` & `Height` - The dimensions of the window +- `Assets` - The application's frontend assets +- `OnStartup` - A callback for when the window is created and is about to start loading the frontend assets +- `OnShutdown` - A callback for when the application is about to quit +- `Bind` - A slice of struct instances that we wish to expose to the frontend + +A full list of application options can be found in the [Options Reference](reference/options). + +#### Assets + +The `Assets` option is mandatory as you can't have a Wails application without frontend assets. Those assets can be any files you would expect to find in a web application - html, js, css, svg, png, etc. **There is no requirement to generate asset bundles** - plain files will do. When the application starts, it will attempt to load `index.html` from your assets and the frontend will essentially work as a browser from that point on. It is worth noting that there is no requirement on where in the `embed.FS` the files live. It is likely that the embed path uses a nested directory relative to your main application code, such as `frontend/dist`: + +```go title="main.go" +//go:embed all:frontend/dist +var assets embed.FS +``` + +At startup, Wails will iterate the embedded files looking for the directory containing `index.html`. All other assets will be loaded relative to this directory. + +As production binaries use the files contained in `embed.FS`, there are no external files required to be shipped with the application. + +When running in development mode using the `wails dev` command, the assets are loaded off disk, and any changes result in a "live reload". The location of the assets will be inferred from the `embed.FS`. + +More details can be found in the [Application Development Guide](guides/application-development.mdx). + +#### Application Lifecycle Callbacks + +Just before the frontend is about to load `index.html`, a callback is made to the function provided in [OnStartup](reference/options.mdx#onstartup). A standard Go context is passed to this method. This context is required when calling the runtime so a standard pattern is to save a reference to in this method. Just before the application shuts down, the [OnShutdown](reference/options.mdx#onshutdown) callback is called in the same way, again with the context. There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in Javascript. It is also possible to hook into the window close (or application quit) event by setting the option [OnBeforeClose](reference/options.mdx#onbeforeclose). + +#### Method Binding + +The `Bind` option is one of the most important options in a Wails application. It specifies which struct methods to expose to the frontend. Think of structs like "controllers" in a traditional web application. When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate Javascript versions of those methods that can be called by the frontend code. + +:::info Nota + +Wails requires that you pass in an _instance_ of the struct for it to bind it correctly + +::: + +In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`: + +```go {16,24} title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`: + +```go {8-10} + //... + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + &mystruct1{}, + &mystruct2{}, + }, + }) + +``` + +When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following: + +- Javascript bindings for all bound methods +- Typescript declarations for all bound methods +- Typescript definitions for all Go structs used as inputs or outputs by the bound methods + +This makes it incredibly simple to call Go code from the frontend, using the same strongly typed datastructures. + +## The Frontend + +### Visão geral + +The frontend is a collection of files rendered by webkit. It's like a browser and webserver in one. There is virtually[^1] no limit to which frameworks or libraries you can use. The main points of interaction between the frontend and your Go code are: + +- Calling bound Go methods +- Calling runtime methods + +### Calling bound Go methods + +When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). The generated files mirror the package names in your application. In the example above, we bind `app`, which has one public method `Greet`. This will lead to the generation of the following files: + +```bash +wailsjs + └─go + └─main + ├─App.d.ts + └─App.js +``` + +Here we can see that there is a `main` package that contains the Javascript bindings for the bound `App` struct, as well as the Typescript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular Javascript function: + +```javascript +// ... +import { Greet } from "../wailsjs/go/main/App"; + +function doGreeting(name) { + Greet(name).then((result) => { + // Do something with result + }); +} +``` + +The Typescript declaration file gives you the correct types for the bound methods: + +```ts +export function Greet(arg1: string): Promise; +``` + +The generated methods return a Promise. A successful call will result in the first return value from the Go call to be passed to the `resolve` handler. An unsuccessful call is when a Go method that has an error type as it's second return value, passes an error instance back to the caller. This is passed back via the `reject` handler. In the example above, `Greet` only returns a `string` so the Javascript call will never reject - unless invalid data is passed to it. + +All data types are correctly translated between Go and Javascript. Even structs. If you return a struct from a Go call, it will be returned to your frontend as a Javascript class. + +:::info Nota + +Struct fields *must* have a valid `json` tag to be included in the generated Typescript. + +Anonymous nested structs are not supported at this time. + +::: + +It is possible to send structs back to Go. Any Javascript map/class passed as an argument that is expecting a struct, will be converted to that struct type. To make this process a lot easier, in `dev` mode, a TypeScript module is generated, defining all the struct types used in bound methods. Using this module, it's possible to construct and send native Javascript objects to the Go code. + +There is also support for Go methods that use structs in their signature. All Go structs specified by a bound method (either as parameters or return types) will have Typescript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and Javascript. + +Example: We update our `Greet` method to accept a `Person` instead of a string: + +```go title="main.go" +type Person struct { + Name string `json:"name"` + Age uint8 `json:"age"` + Address *Address `json:"address"` +} + +type Address struct { + Street string `json:"street"` + Postcode string `json:"postcode"` +} + +func (a *App) Greet(p Person) string { + return fmt.Sprintf("Hello %s (Age: %d)!", p.Name, p.Age) +} +``` + +The `wailsjs/go/main/App.js` file will still have the following code: + +```js title="App.js" +export function Greet(arg1) { + return window["go"]["main"]["App"]["Greet"](arg1); +} +``` + +But the `wailsjs/go/main/App.d.ts` file will be updated with the following code: + +```ts title="App.d.ts" +import { main } from "../models"; + +export function Greet(arg1: main.Person): Promise; +``` + +As we can see, the "main" namespace is imported from a new "models.ts" file. This file contains all the struct definitions used by our bound methods. In this example, this is a `Person` struct. If we look at `models.ts`, we can see how the models are defined: + +```ts title="models.ts" +export namespace main { + export class Address { + street: string; + postcode: string; + + static createFrom(source: any = {}) { + return new Address(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.street = source["street"]; + this.postcode = source["postcode"]; + } + } + export class Person { + name: string; + age: number; + address?: Address; + + static createFrom(source: any = {}) { + return new Person(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.age = source["age"]; + this.address = this.convertValues(source["address"], Address); + } + + convertValues(a: any, classs: any, asMap: boolean = false): any { + if (!a) { + return a; + } + if (a.slice) { + return (a as any[]).map((elem) => this.convertValues(elem, classs)); + } else if ("object" === typeof a) { + if (asMap) { + for (const key of Object.keys(a)) { + a[key] = new classs(a[key]); + } + return a; + } + return new classs(a); + } + return a; + } + } +} +``` + +So long as you have TypeScript as part of your frontend build configuration, you can use these models in the following way: + +```js title="mycode.js" +import { Greet } from "../wailsjs/go/main/App"; +import { main } from "../wailsjs/go/models"; + +function generate() { + let person = new main.Person(); + person.name = "Peter"; + person.age = 27; + Greet(person).then((result) => { + console.log(result); + }); +} +``` + +The combination of generated bindings and TypeScript models makes for a powerful development environment. + +More information on Binding can be found in the [Binding Methods](guides/application-development.mdx#binding-methods) section of the [Application Development Guide](guides/application-development.mdx). + +### Calling runtime methods + +The Javascript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations: + +```js title="mycode.js" +window.runtime.EventsEmit("my-event", 1); +``` + +More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro). + +[^1]: There is a very small subset of libraries that use features unsupported in WebViews. There are often alternatives and workarounds for such cases. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/introduction.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/introduction.mdx new file mode 100644 index 00000000..63022cdd --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/introduction.mdx @@ -0,0 +1,75 @@ +--- +sidebar_position: 1 +--- + +# Introdução + +Wails é um projeto que permite a você escrever aplicativos de desktop usando Go e web. + +Considere uma alternativa leve e rápida do Electron para o Go. Você pode facilmente construir aplicativos com a flexibilidade e o poder do Go, combinados com um frontend rico e moderno. + +### Funcionalidades + +- Menus Nativos, Dialogs, Temas e Transparência +- Suporte a Windows, macOS e Linux +- Modelos embutidos para Svelte, React, Preact, Vue, Lit e Vanilla JS +- Chame métodos do Go facilmente a partir do Javascript +- Construção automática para geração de modelos do Typescript +- Não são necessárias DLLs externas ou CGO no Windows +- Modo de desenvolvimento ao vivo usando o poder do [Vite](https://vitejs.dev/) +- Poderoso CLI para criar, Construir e Empacotar facilmente +- Uma rica [biblioteca de tempo de execução](/docs/reference/runtime/intro) +- Aplicativos construídos com Wails são compatíveis com Apple & Microsoft Store + +Este é [vago](https://varly.app) - um aplicativo para desktop para MacOS & Windows escrito usando Wails. Não só parece ótimo, como também usa menus nativos e translucidez - tudo o que você esperaria de um aplicativo nativo moderno. + +```mdx-code-block +

+ + + +

+``` + +### Criação Rápida de Template + +Há uma série de modelos pré-configurados que permitem que o aplicativo entre em funcionamento rapidamente. Há modelos para os seguintes frameworks: Svelte, React, Vue, Preact, Lit e Vanilla. Existem as versões Javascript e Typescript para cada modelo. + +### Elementos Nativos + +Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build good-looking, feature rich desktop applications. + +**Ele não incorpora um navegador**, então é eficiente em recursos. Ao invés disso, ele usa o mecanismo de renderização nativo para a plataforma. No Windows, esta é a nova biblioteca da Microsoft Webview2, construída no Chromium. + +### Interoperabilidade entre Go e Javascript + +O Wails automaticamente torna seus métodos Go disponíveis para Javascript, para que você possa chamá-los pelo nome a partir do seu frontend! Ele até gera modelos de Typescript para as structs usadas pelos seus métodos Go, então você pode passar as mesmas estruturas de dados entre Go e Javascript. + +### Biblioteca de tempo de execução + +Wails fornece uma biblioteca de tempo de execução, para Go e Javascript, que lida com muitas das coisas que as aplicações modernas precisam, como Evento, Loging, Diálogos, etc. + +### Experiência de Desenvolvimento Ao Vivo + +#### Reconstruções automáticas + +Quando você executar seu aplicativo no modo "dev", o Wails construirá seu aplicativo como uma aplicação de desktop nativa, e lerá seus ativos a partir do disco. Ele detectará quaisquer alterações no seu Código Go e reconstruirá automaticamente e reiniciará seu aplicativo. + +#### Recarregamentos automáticos + +Quando alterações nos assets de seu aplicativo forem detectadas, seu aplicativo em execução irá "recarregar", reflectindo suas alterações quase imediatamente. + +#### Desenvolva sua aplicação com um navegador + +If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver that will run your application in any browser that connects to it. It will even refresh when your assets change on disk. + +### Production-ready Native Binaries + +When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving you total control over how your applications are built. + +### Tooling + +The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting of creating icons, compiling your application with optimal settings and delivering a distributable, production ready binary. Choose from a number of starter templates to get up and running quickly! 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 new file mode 100644 index 00000000..76f5fa82 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -0,0 +1,229 @@ +--- +sidebar_position: 2 +--- + +# Linha de comandos + +A CLI do Wails tem vários comandos que são usados para gerenciar seus projetos. Todos os comandos são executados da seguinte maneira: + +`wails ` + +## init + +`wails init` é usado para gerar projetos. + +| Flag | Descrição | Padrão | +|:------------------------- |:---------------------------------------------------------------------------------------------------------------------------------- |:---------------:| +| -n "nome do projeto" | Nome do projeto. **Obrigatório**. | | +| -d "diretório do projeto" | Diretório de projeto a criar | Nome do projeto | +| -g | Inicializar o repositório git | | +| -l | Listar modelos de projetos disponíveis | | +| -q | Suprimir saída no console | | +| -t "nome do template" | O modelo do projeto a ser usado. Este pode ser o nome de um template padrão ou um URL para um template remoto hospedado no github. | vanilla | +| -ide | Gerar arquivos de projeto IDE | | +| -f | Forçar compilação de aplicação | false | + +Exemplo: `wails init -n test -d mytestproject -g -ide vscode -q` + +Isso irá gerar um projeto chamado "test" no diretório "mytestproject", inicializar o git, gerar arquivos de projeto vscode e fazê-lo silenciosamente. + +Mais informações sobre isso podem ser encontradas [aqui](../guides/ides.mdx). + +### Modelos Remotos + +Modelos remotos (hospedados no GitHub) são suportados e podem ser instalados usando a URL do projeto do template. + +Exemplo: `wails init -n teste -t https://github.com/leaanthony/testtemplate[@v1.0.0]` + +Uma lista de modelos mantidos pela comunidade pode ser encontrada [aqui](../community/templates.mdx) + +:::warning Atenção + +**O projeto Wails não é mantido, não é responsável nem responsável por modelos de terceiros!** + +Se você não tiver certeza sobre um template, inspecione `package.json` e `wails.json` para quais scripts são executados e quais pacotes estão instalados. + +::: + +## build + +`wails build` é usado para compilar seu projeto para um binário pronto para produção. + +| Flag | Descrição | Padrão | +|:-------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------- | +| -platform | Compila para as plataformas [(delimitadas por vírgula)](../reference/cli.mdx#platforms) por exemplo. `windows/arm64`. Note, se você não der arquitetura, `runtime.GOARCH` é usado. | platform = `variável de ambiente GOOS` se determinado `runtime.GOOS`.
arch = `GOARCH` variável de envrionment se for dado `runtime.GOARCH`. | +| -clean | Limpa o diretório `compilação/bin` | | +| -compiler "compiler" | Use um compilador de ida diferente para realizar build, por exemplo, go1.15beta1 | go | +| -ldflags "flags" | Ldflags adicionais para passar para o compilador | | +| -nopackage | Não empacotar aplicação | | +| -o nome de arquivo | Nome do Arquivo de Saída | | +| -s | Pular build do frontend | false | +| -f | Forçar compilação de aplicação | false | +| -tags "extra tags" | Compilar tags para passar para o compilador Go. Deve ser citado. Separados por espaço ou vírgula (mas não ambos) | | +| -upx | Comprimir binário final usando "upx" | | +| -upxflags | Flags para passar para o upx | | +| -v int | Nível de verbosidade(0 - silencioso, 1 - padrão, 2 - verbose) | 1 | +| -webview2 | Estratégia de instalação WebView2: download,embed,browser,error | baixar | +| -u | Atualiza o `go.mod` do seu projeto para usar a mesma versão de Wails que o CLI | | +| -debug | Mantém as informações de depuração no aplicativo. Permite o uso das ferramentas devtools na janela do aplicativo | false | +| -trimpath | Remove todos os caminhos do sistema de arquivo do executável resultante. | false | +| -race | Realiza build com o Go race detector | false | +| -windowsconsole | Manter a janela de console para builds do Windows | | +| -obfuscate | Ofuscar a aplicação usando [garble](https://github.com/burrowers/garble) | false | +| -garbleargs | Argumentos para passar para o garble | `-literals -tiny -seed=random` | + +Para uma descrição detalhada do sinalizador `webview2`, consulte o guia [Windows](../guides/windows.mdx). + +Se você preferir construir usando a ferramenta Go padrão, consulte o guia de [Builds Manuais](../guides/manual-builds.mdx). + +Exemplo: + +`wails build -clean -o myproject.exe` + +:::Info +On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +::: + +:::info UPX no Apple Silicon + +Há alguns [problemas](https://github.com/upx/upx/issues/446) com o uso de UPX com o Apple Silicon. + +::: + +:::info UPX no Windows + +Alguns fornecedores de antivírus marcam como falsos positivos os binários `upx` comprimidos como vírus, veja [problema](https://github.com/upx/upx/issues/437). + +::: + +### Plataformas + +Plataformas Suportadas: + +| Plataforma | Descrição | +|:---------------- |:--------------------------------------------- | +| darwin | MacOS + architecture of build machine | +| darwin/amd64 | MacOS 10.13+ AMD64 | +| darwin/arm64 | MacOS 11.0+ ARM64 | +| darwin/universal | MacOS AMD64+ARM64 universal application | +| windows | Windows 10/11 + architecture of build machine | +| windows/amd64 | Windows 10/11 AMD64 | +| windows/arm64 | Windows 10/11 ARM64 | +| linux | Linux + architecture of build machine | +| linux/amd64 | Linux AMD64 | +| linux/arm64 | Linux ARM64 | + +## doctor + +`wails doctor` executará o diagnóstico para garantir que seu sistema esteja pronto para desenvolvimento. + +Exemplo: + +``` +Wails CLI v2.0.0-beta + +Scanning system - Please wait (this may take a long time)...Done. + +System +------ +OS: Windows 10 Pro +Version: 2009 (Build: 19043) +ID: 21H1 +Go Version: go1.18 +Platform: windows +Architecture: amd64 + +Dependency Package Name Status Version +---------- ------------ ------ ------- +WebView2 N/A Installed 93.0.961.52 +npm N/A Installed 6.14.15 +*upx N/A Installed upx 3.96 + +* - Optional Dependency + +Diagnosis +--------- +Your system is ready for Wails development! + +``` + +## dev + +`wails dev` é usado para executar sua aplicação em um modo de "desenvolvimento ao vivo". Isso significa que: + +- O aplicativo `go.mod` será atualizado para usar a mesma versão do Wails como a CLI +- A aplicação é compilada e executada automaticamente +- Um observador é iniciado e acionará uma reconstrução do seu aplicativo de desenvolvimento se ele detectar alterações em seus arquivos go +- Um servidor web foi iniciado em `http://localhost:34115` que serve sua aplicação (não apenas frontend) sobre http. Isso permite que você use suas extensões de desenvolvimento de navegador favoritas +- Todos os conteúdos do aplicativo são carregados do disco. Se forem alterados, o aplicativo irá recarregar automaticamente (não reconstruir). Todos os navegadores conectados também recarregarão +- Um módulo JS é gerado que fornece o seguinte: + - Wrappers de javascript dos seus métodos Go com JSDoc, gerada automaticamente, fornecendo dicas de código + - Versões do TypeScript de suas structs Go, que podem ser construídas e passadas para os métodos da sua ida +- Um segundo módulo JS é gerado que fornece uma declaração wrapper + TS para o tempo de execução +- No macOS, ele irá empacotar a aplicação em um arquivo `.app` e executá-lo. Será usado um `build/darwin/Info.dev.plist` para desenvolvimento. + +| Flag | Descrição | Padrão | +|:--------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- | +| -assetdir "./caminho/para/midias" | Serve os arquivos a partir do diretório fornecido em vez de usar os arquivos FS fornecidos | Valor em `wails.json` | +| -browser | Abre um navegador para `http://localhost:34115` na inicialização | | +| -compiler "compiler" | Use um compilador de ida diferente para realizar build, por exemplo, go1.15beta1 | go | +| -e | Extensões para acionar reconstruções (separadas por vírgula) | go | +| -reloaddirs | Diretórios adicionais para acionar recarregamentos (separados por vírgula) | Valor em `wails.json` | +| -ldflags "flags" | Ldflags adicionais para passar para o compilador | | +| -tags "extra tags" | Compilar tags para passar para o compilador (citado e espaço separado) | | +| -loglevel "loglevel" | Nível de log a ser usado - Trace, Debug, Info, Warning, Error | Debug | +| -noreload | Desativar a recarga automática quando os arquivos forem alterados | | +| -nocolour | Desativar saída da colorida da cli | false | +| -nogen | Desativar módulo de geração | | +| -v | Nível de verbosidade(0 - silencioso, 1 - padrão, 2 - verbose) | 1 | +| -wailsjsdir | O diretório para gerar os módulos gerados do Wails JS | Valor em `wails.json` | +| -debounce | O tempo de esperar por recarregar depois que uma alteração de ativo for detectada | 100 (milliseconds) | +| -devserver "host:port" | O endereço para vincular o servidor de desenvolvimento de wails a | "localhost:34115" | +| -frontenddevserverurl "url" | Usar URL do servidor de desenvolvimento de terceiros para servir midias, Vite EG | "" | +| -appargs "args" | Argumentos passados para o aplicativo no estilo shell | | +| -save | Salva o `assetdir`, `reloaddirs`,`wailsjsdir`,`debounce`,`devserver` e `frontenddevserverurl` passado, flag em `wails.json` para realizar chamadas subsequentes. | | +| -race | Realiza build com o Go race detector | false | +| -s | Pular build do frontend | false | + +Exemplo: + +`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser` + +Este comando fará o seguinte: + +- Compilação do aplicativo e execução (mais detalhes [aqui](../guides/manual-builds.mdx) +- Gerar os módulos JS de Wails em `./frontend/src` +- Assistir por atualizações em arquivos em `./frontend/dist` e recarregar em qualquer alteração +- Abrir um navegador e conectar-se ao aplicativo + +Há mais informações sobre como usar este recurso com scripts de framework existentes [aqui](../guides/application-development.mdx#live-reloading). + +## generate + +### template + +A Wails usa modelos para a geração de projeto. O comando `wails generate template` ajuda a fazer um template para que ele possa ser usado para gerar projetos. + +| Flag | Descrição | +|:---------------- |:----------------------------------------------------- | +| -name | O nome do template (Obrigatório) | +| -frontend "path" | Caminho para o projeto frontend para usar no template | + +Para mais detalhes sobre a criação de modelos, consulte o [guia de Modelos](../guides/templates.mdx). + +### module + +O comando `wails generate template` permite que você gere manualmente o diretório `wailsjs` para o seu aplicativo. + +## update + +`wails update` irá atualizar a versão da CLI do Wails. + +| Flag | Descrição | +|:------------------ |:------------------------------------- | +| -pre | Atualizar para a versão mais recente | +| -version "version" | Instalar uma versão específica do CLI | + +## version + +`wails version` simplesmente irá retornar a versão CLI atual. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx new file mode 100644 index 00000000..304f57d6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/menus.mdx @@ -0,0 +1,227 @@ +--- +sidebar_position: 4 +--- + +# Menus + +It is possible to add an application menu to Wails projects. This is achieved by defining a [Menu](#menu) struct and setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu). + +An example of how to create a menu: + +```go + AppMenu := menu.NewMenu() + FileMenu := AppMenu.AddSubmenu("File") + FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile) + FileMenu.AddSeparator() + FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) { + runtime.Quit() + }) + + if runtime.GOOS == "darwin" { + AppMenu.Append(menu.EditMenu()) // on macos platform, we should append EditMenu to enable Cmd+C,Cmd+V,Cmd+Z... shortcut + } + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + Menu: AppMenu, + Bind: []interface{}{ + app, + }, + ) + // ... +``` + +It is also possible to dynamically update the menu, by updating the menu struct and calling [MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu). + +The example above uses helper methods, however it's possible to build the menu structs manually. + +## Menu + +A Menu is a collection of MenuItems: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Menu struct { + Items []*MenuItem +} +``` + +For the Application menu, each MenuItem represents a single menu such as "Edit". + +A simple helper method is provided for building menus: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func NewMenuFromItems(first *MenuItem, rest ...*MenuItem) *Menu +``` + +This makes the layout of the code more like that of a menu without the need to add the menu items manually after creating them. Alternatively, you can just create the menu items and add them to the menu manually. + +## MenuItem + +A MenuItem represents an item within a Menu. + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +// MenuItem represents a menu item contained in a menu +type MenuItem struct { + Label string + Role Role + Accelerator *keys.Accelerator + Type Type + Disabled bool + Hidden bool + Checked bool + SubMenu *Menu + Click Callback +} +``` + +| Field | Type | Notes | +| ----------- | ------------------------------------ | ------------------------------------------------------------- | +| Label | string | The menu text | +| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item | +| Type | [Type](#type) | Type of MenuItem | +| Disabled | bool | Disables the menu item | +| Hidden | bool | Hides this menu item | +| Checked | bool | Adds check to item (Checkbox & Radio types) | +| SubMenu | [\*Menu](#menu) | Sets the submenu | +| Click | [Callback](#callback) | Callback function when menu clicked | +| Role | string | Defines a [role](#role) for this menu item. Mac only for now. | + +### Accelerator + +Accelerators (sometimes called keyboard shortcuts) define a binding between a keystroke and a menu item. Wails defines an Accelerator as a combination or key + [Modifier](#modifier). They are available in the `"github.com/wailsapp/wails/v2/pkg/menu/keys"` package. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut := keys.CmdOrCtrl("o") +``` + +Keys are any single character on a keyboard with the exception of `+`, which is defined as `plus`. Some keys cannot be represented as characters so there are a set of named characters that may be used: + +| | | | | +|:-----------:|:-----:|:-----:|:---------:| +| `backspace` | `f1` | `f16` | `f31` | +| `tab` | `f2` | `f17` | `f32` | +| `return` | `f3` | `f18` | `f33` | +| `enter` | `f4` | `f19` | `f34` | +| `escape` | `f5` | `f20` | `f35` | +| `left` | `f6` | `f21` | `numlock` | +| `right` | `f7` | `f22` | | +| `up` | `f8` | `f23` | | +| `down` | `f9` | `f24` | | +| `space` | `f10` | `f25` | | +| `delete` | `f11` | `f36` | | +| `home` | `f12` | `f37` | | +| `end` | `f13` | `f38` | | +| `page up` | `f14` | `f39` | | +| `page down` | `f15` | `f30` | | + +Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut, err := keys.Parse("Ctrl+Option+A") +``` + +#### Modifier + +The following modifiers are keys that may be used in combination with the accelerator key: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +const ( + // CmdOrCtrlKey represents Command on Mac and Control on other platforms + CmdOrCtrlKey Modifier = "cmdorctrl" + // OptionOrAltKey represents Option on Mac and Alt on other platforms + OptionOrAltKey Modifier = "optionoralt" + // ShiftKey represents the shift key on all systems + ShiftKey Modifier = "shift" + // ControlKey represents the control key on all systems + ControlKey Modifier = "ctrl" +) +``` + +A number of helper methods are available to create Accelerators using modifiers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +func CmdOrCtrl(key string) *Accelerator +func OptionOrAlt(key string) *Accelerator +func Shift(key string) *Accelerator +func Control(key string) *Accelerator +``` + +Modifiers can be combined using `keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines "Ctrl+Option+A" on Mac and "Ctrl+Alt+A" on Window/Linux + myShortcut := keys.Combo("a", ControlKey, OptionOrAltKey) +``` + +### Type + +Each menu item must have a type and there are 5 types available: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +const ( + TextType Type = "Text" + SeparatorType Type = "Separator" + SubmenuType Type = "Submenu" + CheckboxType Type = "Checkbox" + RadioType Type = "Radio" +) +``` + +For convenience, helper methods are provided to quickly create a menu item: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func Text(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func Separator() *MenuItem +func Radio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func Checkbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func SubMenu(label string, menu *Menu) *Menu +``` + +You can also create menu items directly on a menu by using the "Add" helpers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func (m *Menu) AddText(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSeparator() *MenuItem +func (m *Menu) AddRadio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddCheckbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSubMenu(label string, menu *Menu) *MenuI +``` + +A note on radio groups: A radio group is defined as a number of radio menu items that are next to each other in the menu. This means that you do not need to group items together as it is automatic. However, that also means you cannot have 2 radio groups next to each other - there must be a non-radio item between them. + +### Callback + +Each menu item may have a callback that is executed when the item is clicked: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Callback func(*CallbackData) + +type CallbackData struct { + MenuItem *MenuItem +} +``` + +The function is given a `CallbackData` struct which indicates which menu item triggered the callback. This is useful when using radio groups that may share a callback. + +### Role + +:::info Roles + +Roles are currently supported on Mac only. + +::: + +A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles: + +| Role | Description | +| ------------ | ------------------------------------------------------------------------ | +| AppMenuRole | The standard Mac application menu. Can be created using `menu.AppMenu()` | +| EditMenuRole | The standard Mac edit menu. Can be created using `menu.EditMenu()` | 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 new file mode 100644 index 00000000..8c0df21b --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -0,0 +1,736 @@ +--- +sidebar_position: 3 +--- + +# Opções + +## Application Options + +The `Options.App` struct contains the application configuration. It is passed to the `wails.Run()` method: + +```go title="Example" +import ( + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "github.com/wailsapp/wails/v2/pkg/options/linux" + "github.com/wailsapp/wails/v2/pkg/options/mac" + "github.com/wailsapp/wails/v2/pkg/options/windows" +) + +func main() { + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + DisableResize: false, + Fullscreen: false, + WindowStartState: options.Maximised, + Frameless: true, + MinWidth: 400, + MinHeight: 400, + MaxWidth: 1280, + MaxHeight: 1024, + StartHidden: false, + HideWindowOnClose: false, + BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255}, + AlwaysOnTop: false, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: assetsHandler, + Middleware: assetsMidldeware, + }, + Menu: app.applicationMenu(), + Logger: nil, + LogLevel: logger.DEBUG, + LogLevelProduction: logger.ERROR, + OnStartup: app.startup, + OnDomReady: app.domready, + OnShutdown: app.shutdown, + OnBeforeClose: app.beforeClose, + CSSDragProperty: "--wails-draggable", + CSSDragValue: "drag", + ZoomFactor: 1.0, + IsZoomControlEnabled: false, + Bind: []interface{}{ + app, + }, + Windows: &windows.Options{ + WebviewIsTransparent: false, + WindowIsTranslucent: false, + BackdropType: windows.Mica, + DisableWindowIcon: false, + DisableFramelessWindowDecorations: false, + WebviewUserDataPath: "", + WebviewBrowserPath: "", + Theme: windows.SystemDefault, + CustomTheme: &windows.ThemeSettings{ + DarkModeTitleBar: windows.RGB(20, 20, 20), + DarkModeTitleText: windows.RGB(200, 200, 200), + DarkModeBorder: windows.RGB(20, 0, 20), + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + }, + // User messages that can be customised + Messages *windows.Messages + // OnSuspend is called when Windows enters low power mode + OnSuspend func() + // OnResume is called when Windows resumes from low power mode + OnResume func() + }, + Mac: &mac.Options{ + TitleBar: &mac.TitleBar{ + TitlebarAppearsTransparent: true, + HideTitle: false, + HideTitleBar: false, + FullSizeContent: false, + UseToolbar: false, + HideToolbarSeparator: true, + }, + Appearance: mac.NSAppearanceNameDarkAqua, + WebviewIsTransparent: true, + WindowIsTranslucent: false, + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + Linux: &linux.Options{ + Icon: icon, + WindowIsTranslucent: false, + }, + Debug: options.Debug{ + OpenInspectorOnStartup: false, + }, + }) + + if err != nil { + log.Fatal(err) + } +} + +``` + +### Title + +The text shown in the window's title bar. + +Name: Title
Type: `string` + +### Width + +The initial width of the window. + +Name: Width
Type: `int`
Default: 1024. + +### Height + +The initial height of the window. + +Name: Height
Type: `int`
Default: 768 + +### DisableResize + +By default, the main window is resizable. Setting this to `true` will keep it a fixed size. + +Name: DisableResize
Type: `bool` + +### Fullscreen + +Deprecated: Please use [WindowStartState](#windowstartstate). + +### WindowStartState + +Defines how the window should present itself at startup. + +| Valor | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +Name: WindowStartState
Type: `options.WindowStartState` + +### Frameless + +When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx). + +Name: Frameless
Type: `bool` + +### MinWidth + +This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default. + +Name: MinWidth
Type: `int` + +### MinHeight + +This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default. + +Name: MinHeight
Type: `int` + +### MaxWidth + +This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default. + +Name: MaxWidth
Type: `int` + +### MaxHeight + +This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default. + +Name: MaxHeight
Type: `int` + +### StartHidden + +When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called. + +Name: StartHidden
Type: `bool` + +### HideWindowOnClose + +By default, closing the window will close the application. Setting this to `true` means closing the window will + +hide the window instead. + +Name: HideWindowOnClose
Type: `bool` + +### BackgroundColour + +This value is the default background colour of the window. Example: options.NewRGBA(255,0,0,128) - Red at 50% transparency + +Name: BackgroundColour
Type: `*options.RGBA`
Default: white + +### AlwaysOnTop + +Indicates that the window should stay above other windows when losing focus. + +Name: AlwaysOnTop
Type: `bool` + +### Assets + +Deprecated: Please use Assets on [AssetServer specific options](#assetserver). + +### AssetsHandler + +Deprecated: Please use AssetsHandler on [AssetServer specific options](#assetserver). + +### AssetServer + +This defines AssetServer specific options. It allows to customize the AssetServer with static assets, serving assets dynamically with an `http.Handler` or hook into the request chain with an `assetserver.Middleware`. + +Not all features of an `http.Request` are currently supported, please see the following feature matrix: + +| Feature | Win | Mac | Lin | +| ----------------------- | --- | --- | --- | +| GET | ✅ | ✅ | ✅ | +| POST | ✅ | ✅ | ❌ | +| PUT | ✅ | ✅ | ❌ | +| PATCH | ✅ | ✅ | ❌ | +| DELETE | ✅ | ✅ | ❌ | +| Request Headers | ✅ | ✅ | ❌ | +| Request Body | ✅ | ✅ | ❌ | +| Request Body Streaming | ❌ | ❌ | ❌ | +| Response StatusCodes | ✅ | ✅ | ❌ | +| Response Headers | ✅ | ✅ | ❌ | +| Response Body | ✅ | ✅ | ✅ | +| Response Body Streaming | ❌ | ❌ | ✅ | +| WebSockets | ❌ | ❌ | ❌ | + +NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support. + +Name: AssetServer
Type: `*assetserver.Options` + +#### Assets + +The static frontend assets to be used by the application. + +A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. + +If set to nil, all GET requests will be forwarded to [Handler](#handler). + +Name: Assets
Type: `fs.FS` + +#### Handler + +The assets handler is a generic `http.Handler` for fallback handling of assets that can't be found. + +The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. If not defined, the result is the following in cases where the Handler would have been called: + +- GET request: `http.StatusNotFound` +- Other request: `http.StatusMethodNotAllowed` + +NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension. + +Name: AssetsHandler
Type: `http.Handler` + +#### Middleware + +Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default request handler dynamically, e.g. implement specialized Routing etc. The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default handler used by the AssetServer as an argument. + +If not defined, the default AssetServer request chain is executed. + +Name: Middleware
Type: `assetserver.Middleware` + +### Menu + +The menu to be used by the application. More details about Menus in the [Menu Reference](../reference/runtime/menu.mdx). + +:::note + +On Mac, if no menu is specified, a default menu will be created. + +::: + +Name: Menu
Type: `*menu.Menu` + +### Logger + +The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: Logger
Type: `logger.Logger`
Default: Logs to Stdout + +### LogLevel + +The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevel
Type: `logger.LogLevel`
Default: `Info` in dev mode, `Error` in production mode + +### LogLevelProduction + +The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevelProduction
Type: `logger.LogLevel`
Default: `Error` + +### OnStartup + +This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context. + +Name: OnStartup
Type: `func(ctx context.Context)` + +### OnDomReady + +This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context. + +Name: OnDomReady
Type: `func(ctx context.Context)` + +### OnShutdown + +This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context. + +Name: OnShutdown
Type: `func(ctx context.Context)` + +### OnBeforeClose + +If this callback is set, it will be called when the application is about to quit, either by clicking the window close button or calling `runtime.Quit`. Returning true will cause the application to continue, false will continue shutdown as normal. This is good for confirming with the user that they wish to exit the program. + +Example: + +```go title=windowsapp.go +func (b *App) beforeClose(ctx context.Context) (prevent bool) { + dialog, err := runtime.MessageDialog(ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Quit?", + Message: "Are you sure you want to quit?", + }) + + if err != nil { + return false + } + return dialog != "Yes" +} +``` + +Name: OnBeforeClose
Type: `func(ctx context.Context) bool` + +### CSSDragProperty + +Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`. + +Name: CSSDragProperty
Type: `string` + +### CSSDragValue + +Indicates what value the `CSSDragProperty` style should have to drag the window. Default: `drag`. + +Name: CSSDragValue
Type: `string` + +### ZoomFactor + +Name: ZoomFactor
Type: `float64` + +This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. + +### IsZoomControlEnabled + +Name: IsZoomControlEnabled
Type: `bool` + +This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar). + +### Bind + +A slice of struct instances defining methods that need to be bound to the frontend. + +Name: Bind
Type: `[]interface{}` + +### Windows + +This defines [Windows specific options](#windows). + +Name: Windows
Type: `*windows.Options` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent). + +For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw) method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the newer translucency types that are much faster. By default, the type of translucency used will be determined by Windows. To configure this, use the [BackdropType](#BackdropType) option. + +Name: WindowIsTranslucent
Type: `bool` + +#### BackdropType + +:::note + +Requires Windows 11 build 22621 or later. + +::: + +Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`. + +Name: BackdropType
Type `windows.BackdropType` + +The value can be one of the following: + +| Valor | Description | +| ------- | ----------------------------------------------------------------------------------------- | +| Auto | Let Windows decide which backdrop to use | +| None | Do not use translucency | +| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect | +| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect | +| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | + +#### DisableWindowIcon + +Setting this to `true` will remove the icon in the top left corner of the title bar. + +Name: DisableWindowIcon
Type: `bool` + +#### DisableFramelessWindowDecorations + +Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11. + +Name: DisableFramelessWindowDecorations
Type: `bool` + +#### WebviewUserDataPath + +This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used. + +Name: WebviewUserDataPath
Type: `string` + +#### WebviewBrowserPath + +This defines the path to a directory with WebView2 executable files and libraries. If empty, webview2 installed in the system will be used. + +Important information about distribution of fixed version runtime: + +- [How to get and extract runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode) +- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version) +- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions) + +Name: WebviewBrowserPath
Type: `string` + +#### Theme + +Minimum Windows Version: Windows 10 2004/20H1 + +This defines the theme that the application should use: + +| Valor | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| SystemDefault | _Default_. The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting | +| Dark | The application will use a dark theme exclusively | +| Light | The application will use a light theme exclusively | + +Name: Theme
Type: `windows.Theme` + +#### CustomTheme + +:::note + +Minimum Windows Version: Windows 10/11 2009/21H2 Build 22000 + +::: + +Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive. + +Name: CustomTheme
Type: `windows.CustomTheme` + +##### CustomTheme type + +The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`. + +NOTE: Any value not provided will default to black. + +```go +type ThemeSettings struct { + DarkModeTitleBar int32 + DarkModeTitleBarInactive int32 + DarkModeTitleText int32 + DarkModeTitleTextInactive int32 + DarkModeBorder int32 + DarkModeBorderInactive int32 + LightModeTitleBar int32 + LightModeTitleBarInactive int32 + LightModeTitleText int32 + LightModeTitleTextInactive int32 + LightModeBorder int32 + LightModeBorderInactive int32 +} +``` + +Example: + +```go + CustomTheme: &windows.ThemeSettings{ + // Theme to use when window is active + DarkModeTitleBar: windows.RGB(255, 0, 0), // Red + DarkModeTitleText: windows.RGB(0, 255, 0), // Green + DarkModeBorder: windows.RGB(0, 0, 255), // Blue + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + // Theme to use when window is inactive + DarkModeTitleBarInactive: windows.RGB(128, 0, 0), + DarkModeTitleTextInactive: windows.RGB(0, 128, 0), + DarkModeBorderInactive: windows.RGB(0, 0, 128), + LightModeTitleBarInactive: windows.RGB(100, 100, 100), + LightModeTitleTextInactive: windows.RGB(10, 10, 10), + LightModeBorderInactive: windows.RGB(100, 100, 100), + }, +``` + +#### Messages + +A struct of strings used by the webview2 installer if a valid webview2 runtime is not found. + +Name: Messages
Type: `*windows.Messages` + +Customise this for any language you choose to support. + +#### ResizeDebounceMS + +ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can. + +Name: ResizeDebounceMS
Type: `uint16` + +#### OnSuspend + +If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate) + +Name: OnSuspend
Type: `func()` + +#### OnResume + +If set, this function will be called when Windows resumes from low power mode (suspend/hibernate) + +Name: OnResume
Type: `func()` + +### Mac + +This defines [Mac specific options](#mac). + +Name: Mac
Type: `*mac.Options` + +#### TitleBar + +The TitleBar struct provides the ability to configure the look and feel of the title bar. + +Name: TitleBar
Type: [`*mac.TitleBar`](#titlebar-struct) + +##### Titlebar struct + +The titlebar of the application can be customised by using the TitleBar options: + +```go +type TitleBar struct { + TitlebarAppearsTransparent bool + HideTitle bool + HideTitleBar bool + FullSizeContent bool + UseToolbar bool + HideToolbarSeparator bool +} +``` + +| Name | Description | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| TitlebarAppearsTransparent | Makes the titlebar transparent. This has the effect of hiding the titlebar and the content fill the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc) | +| HideTitle | Hides the title of the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc) | +| HideTitleBar | Removes [NSWindowStyleMaskTitled](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktitled/) from the style mask | +| FullSizeContent | Makes the webview fill the entire window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemaskfullsizecontentview) | +| UseToolbar | Adds a default toolbar to the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar?language=objc) | +| HideToolbarSeparator | Removes the line beneath the toolbar. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar/1516954-showsbaselineseparator?language=objc) | + +Preconfigured titlebar settings are available: + +| Setting | Example | +| --------------------------- | ---------------------------------------------- | +| `mac.TitleBarDefault()` | ![](/img/reference/titlebar-default.webp) | +| `mac.TitleBarHidden()` | ![](/img/reference/titlebar-hidden.webp) | +| `mac.TitleBarHiddenInset()` | ![](/img/reference/titlebar-hidden-inset.webp) | + +Example: + +```go +Mac: &mac.Options{ + TitleBar: mac.TitleBarHiddenInset(), +} +``` + +Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on customising the titlebar. + +#### Appearance + +Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names. + +Name: Appearance
Type: [`mac.AppearanceType`](#appearance-type) + +##### Appearance type + +You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc). + +| Valor | Description | +| ----------------------------------------------------- | --------------------------------------------------------------- | +| DefaultAppearance | DefaultAppearance uses the default system value | +| NSAppearanceNameAqua | The standard light system appearance | +| NSAppearanceNameDarkAqua | The standard dark system appearance | +| NSAppearanceNameVibrantLight | The light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastAqua | A high-contrast version of the standard light system appearance | +| NSAppearanceNameAccessibilityHighContrastDarkAqua | A high-contrast version of the standard dark system appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantLight | A high-contrast version of the light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantDark | A high-contrast version of the dark vibrant appearance | + +Example: + +```go +Mac: &mac.Options{ + Appearance: mac.NSAppearanceNameDarkAqua, +} +``` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications. + +Name: WindowIsTranslucent
Type: `bool` + +#### About + +This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role. + +Name: About
Type: [`*mac.AboutInfo`](#about-struct) + +##### About struct + +```go + +type AboutInfo struct { + Title string + Message string + Icon []byte +} +``` + +If these settings are provided, an "About" menu item will appear in the app menu (when using the `AppMenu` role). Given this configuration: + +```go +//go:embed build/appicon.png +var icon []byte + +func main() { + err := wails.Run(&options.App{ + ... + Mac: &mac.Options{ + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + }) +``` + +The "About" menu item will appear in the app menu: + +```mdx-code-block +
+ +
+
+``` + +When clicked, that will open an about message box: + +```mdx-code-block +
+ +
+
+``` + +### Linux + +This defines [Linux specific options](#linux). + +Name: Linux
Type: `*linux.Options` + +#### Icon + +Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified). + +Name: Icon
Type: `[]byte` + +Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. + +NOTE: Gnome on Wayland at least does not display this icon. To have a application icon there, a `.desktop` file has to be used. On KDE it should work. + +The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality. + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window. + +Name: WindowIsTranslucent
Type: `bool` + +### Debug + +This defines [Debug specific options](#Debug) that apply to debug builds. + +Name: Debug
Type: `options.Debug` + +#### OpenInspectorOnStartup + +Setting this to `true` will open the WebInspector on startup of the application. + +Name: OpenInspectorOnStartup
Type: `bool` 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 new file mode 100644 index 00000000..f573a4ad --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -0,0 +1,57 @@ +--- +sidebar_position: 5 +--- + +# Project Config + +The project config resides in the `wails.json` file in the project directory. The structure of the config is: + +```json +{ + "name": "[The project name]", + "assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]", + "reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]", + "build:dir": "[The directory where the build files reside. Defaults to 'build']", + "frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']", + "frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]", + "frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]", + "frontend:dev": "[This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build]", + "frontend:dev:build": "[This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev]", + "frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]", + "frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]", + "frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output]", + "wailsjsdir": "[Relative path to the directory that the auto-generated JS modules will be created]", + "version": "[Project config version]", + "outputfilename": "[The name of the binary]", + "debounceMS": 100, // The default time the dev server waits to reload when it detects a change in assets + "devServer": "[Address to bind the wails dev sever to. Default: localhost:34115]", + "appargs": "[Arguments passed to the application in shell style when in dev mode]", + "runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS. + "preBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]" + }, + "postBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]" + }, + "info": { // Data used to populate manifests and version info. + "companyName": "[The company name. Default: [The project name]]", + "productName": "[The product name. Default: [The project name]]", + "productVersion": "[The version of the product. Default: '1.0.0']", + "copyright": "[The copyright of the product. Default: 'Copyright.........']", + "comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']" + }, + "nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple']", + "obfuscated": "[Whether the app should be obfuscated. Default: false]", + "garbleargs": "[The arguments to pass to the garble command when using the obfuscated flag]" +} +``` + +This file is read by the Wails CLI when running `wails build` or `wails dev`. + +The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs. + +The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json). diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx new file mode 100644 index 00000000..2af4a03a --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +--- + +# Navegador + +Esses métodos estão relacionados com o navegador do sistema. + +### BrowserOpenURL + +Abre a URL fornecida no navegador do sistema. + +Go: `BrowserOpenURL(ctx context.Context, url string)`
JS: `BrowserOpenURL(url string)` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx new file mode 100644 index 00000000..c7329b42 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx @@ -0,0 +1,302 @@ +--- +sidebar_position: 5 +--- + +# Diálogo + +Esta parte do tempo de execução fornece acesso a dialogos nativos, como os Seletores de Arquivo e caixas de mensagem. + +:::info Javascript + +O dialog não é suportado pelo runtime do JS. + +::: + +### OpenDirectoryDialog + +Abre um diálogo que solicita o usuário para selecionar um diretório. Pode ser personalizado usando o [OpenDialogOptions](#opendialogoptions). + +Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Retorna: Diretório selecionado (nulo se o usuário cancelar) ou um erro + +### OpenFileDialog + +Abre um diálogo que solicita o usuário para selecionar um arquivo. Pode ser personalizado usando o [OpenDialogOptions](#opendialogoptions). + +Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Retorna: Arquivo selecionado (nulo se o usuário cancelar) ou um erro + +### OpenMultipleFilesDialog + +Abre um diálogo que pede o usuário para selecionar vários arquivos. Pode ser personalizado usando o [OpenDialogOptions](#opendialogoptions). + +Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)` + +Retorna: Arquivos selecionados (nulo se o usuário cancelar) ou um erro + +### SaveFileDialog + +Abre um diálogo que solicita o usuário selecionar um nome de arquivo para salvar. Pode ser personalizado usando [SaveDialogOptions](#savedialogoptions). + +Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)` + +Retorna: O arquivo selecionado (nulo se o usuário cancelar) ou um erro + +### MessageDialog + +Exibe uma mensagem usando a caixa de diálogo da mensagem. Pode ser personalizado usando o [MessageDialogOptions](#messagedialogoptions). + +Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)` + +Retorna: O texto do botão selecionado ou um erro + +## Opções + +### OpenDialogOptions + +```go +type OpenDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + ResolvesAliases bool + TreatPackagesAsDirectories bool +} +``` + +| Atributo | Descrição | Win | Mac | Lin | +| -------------------------- | ------------------------------------------------------------- | --- | --- | --- | +| DefaultDirectory | O diretório que a caixa de diálogo será exibida quando aberta | ✅ | ✅ | ✅ | +| DefaultFilename | O nome do arquivo padrão | ✅ | ✅ | ✅ | +| Title | Título para a caixa de diálogo | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | Uma lista de filtros de arquivos | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Exibir arquivos ocultos pelo sistema | | ✅ | ✅ | +| CanCreateDirectories | Permitir que o usuário crie diretórios | | ✅ | | +| ResolvesAliases | Se verdadeiro, retorna o arquivo não o alias | | ✅ | | +| TreatPackagesAsDirectories | Permitir a navegação em pacotes | | ✅ | | + +### SaveDialogOptions + +```go +type SaveDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + TreatPackagesAsDirectories bool +} +``` + +| Atributo | Descrição | Win | Mac | Lin | +| -------------------------- | ------------------------------------------------------------- | --- | --- | --- | +| DefaultDirectory | O diretório que a caixa de diálogo será exibida quando aberta | ✅ | ✅ | ✅ | +| DefaultFilename | O nome do arquivo padrão | ✅ | ✅ | ✅ | +| Title | Título para a caixa de diálogo | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | Uma lista de filtros de arquivos | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Exibir arquivos ocultos pelo sistema | | ✅ | ✅ | +| CanCreateDirectories | Permitir que o usuário crie diretórios | | ✅ | | +| TreatPackagesAsDirectories | Permitir a navegação em pacotes | | ✅ | | + +### MessageDialogOptions + +```go +type MessageDialogOptions struct { + Type DialogType + Title string + Message string + Buttons []string + DefaultButton string + CancelButton string +} +``` + +| Atributo | Descrição | Win | Mac | Lin | +| ------------- | ------------------------------------------------------------------------ | -------------- | --- | --- | +| Tipo | O tipo de diálogo de mensagem, por exemplo, pergunta, informações... | ✅ | ✅ | ✅ | +| Title | Título para a caixa de diálogo | ✅ | ✅ | ✅ | +| Message | A mensagem para mostrar o usuário | ✅ | ✅ | ✅ | +| Buttons | Uma lista de títulos de botões | | ✅ | | +| DefaultButton | O botão com este texto deve ser tratado como padrão. Vincule a `return`. | ✅[*](#windows) | ✅ | | +| CancelButton | O botão com este texto deve ser tratado como padrão. Vincule a `return` | | ✅ | | + +#### Windows + +Windows tem tipos de diálogo padrão em que os botões não são personalizáveis. O valor retornado será um dos: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue". + +Para diálogos de Perguntas, o botão padrão é "Sim" e o botão cancelar é "Não". Isso pode ser alterado definindo o valor do `DefaultButton` para `"No"`. + +Exemplo: +```go + result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Question", + Message: "Do you want to continue?", + DefaultButton: "No", + }) +``` + +#### Linux + +Linux tem tipos de diálogo padrão em que os botões não são personalizáveis. O valor retornado será um de: "Ok", "Cancel", "Yes", "No" + +#### Mac + +Uma caixa de diálogo de mensagem no Mac pode especificar até 4 botões. Se nenhum `DefaultButton` ou `CancelButton` for dado, o primeiro botão é considerado padrão e está ligado à chave `return`. + +Para o código a seguir: + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, +}) +``` + +o primeiro botão é mostrado como padrão: + +```mdx-code-block +
+ +
+
+``` + +E se especificarmos o `DefaultButton` como "two": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", +}) +``` + +o segundo botão será mostrado como padrão. Quando `return` é pressionado, o valor "dois" é retornado. + +```mdx-code-block +
+ +
+
+``` + +Se especificarmos agora o `CancelButton` como "três: + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", + CancelButton: "three", +}) +``` + +o botão com "três" é mostrado na parte inferior do diálogo. Quando `escape` é pressionado, o valor "três" é retornado: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### DialogType + +```go +const ( + InfoDialog DialogType = "info" + WarningDialog DialogType = "warning" + ErrorDialog DialogType = "error" + QuestionDialog DialogType = "question" + ) +``` + +### FileFilter + +```go +type FileFilter struct { + DisplayName string // Filter information EG: "Image Files (*.jpg, *.png)" + Pattern string // semi-colon separated list of extensions, EG: "*.jpg;*.png" +} +``` + +#### Windows + +O Windows permite que você use vários filtros de arquivos em caixas de diálogo. Cada FileFilter aparecerá como uma entrada separada na caixa de diálogo: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Linux + +Linux permite que você use vários filtros de arquivo em caixas de diálogo. Cada FileFilter aparecerá como uma entrada separada na caixa de diálogo: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Mac + +As caixas de diálogo Mac possuem apenas o conceito de um único conjunto de padrões para filtrar arquivos. Se vários Filtros forem fornecidos, o Wails usará todos os padrões definidos. + +Exemplo: + +```go + selection, err := runtime.OpenFileDialog(b.ctx, runtime.OpenDialogOptions{ + Title: "Select File", + Filters: []runtime.FileFilter{ + { + DisplayName: "Images (*.png;*.jpg)", + Pattern: "*.png;*.jpg", + }, { + DisplayName: "Videos (*.mov;*.mp4)", + Pattern: "*.mov;*.mp4", + }, + }, + }) +``` + +Isso resultará na caixa de diálogo Abrir Arquivo usando `*.png,*.jpg,*.mov,*.mp4` como filtro. diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx new file mode 100644 index 00000000..11b08ce1 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# Eventos + +O tempo de execução do Wails fornece um sistema unificado de eventos onde os eventos podem ser emitidos ou recebidos por Go ou Javascript. Opcionalmente, dados podem ser passados com os eventos. Os ouvintes receberão os dados nos tipos de dados locais. + +### EventsOn + +Este método configura um ouvinte para o nome do evento. Quando um evento do tipo `eventName` é [emitted](#EventsEmit), a callback é acionada. Quaisquer dados adicionais enviados com o evento emitido serão passados para o retorno de chamada. Retorna uma função para cancelar o ouvinte. + +Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOff + +Este método desregistra o listener para o nome do evento, opcionalmente várias listagens podem ser desregistradas via `adicionalEventNames`. + +Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...string)`
JS: `EventsOff(eventName string, ...additionalEventNames)` + +### EventsOnce + +Esse método configura um listener para o nome do evento, mas só será acionado uma vez. Retorna uma função para cancelar o ouvinte. + +Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOnMultiple + +Este método configura um listener para o nome do evento, mas acionará apenas um máximo de `counter` vezes. Retorna uma função para cancelar o ouvinte. + +Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`
JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void` + +### EventsEmit + +Este método emite o evento fornecido. Os dados opcionais podem ser passados com o evento. Isto irá acionar quaisquer ouvintes de eventos. + +Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`
JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx new file mode 100644 index 00000000..33d00b17 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx @@ -0,0 +1,84 @@ +--- +sidebar_position: 1 +--- + +# Introdução + +O runtime é uma biblioteca que fornece métodos utilitários para sua aplicação. Existe tanto um tempo de execução Go quanto Javascript e o objetivo é tentar mantê-los na paridade quando possível. + +Ele tem métodos de utilitário para: + +- [Janelas](window.mdx) +- [Menus](menu.mdx) +- [Caixa de diálogo](dialog.mdx) +- [Eventos](events.mdx) +- [Navegador](browser.mdx) +- [Registro](log.mdx) + +O runtime do Go está disponível através da importação de `github.com/wailsapp/wails/v2/pkg/runtime`. Todos os métodos neste pacote assumem um contexto como o primeiro parâmetro. Este contexto deve ser obtido a partir dos ganchos [OnStartup](../options.mdx#onstartup) ou [OnDomReady](../options.mdx#ondomready). + +:::info Nota + +Embora o contexto seja fornecido para o método [Inicialização](../options.mdx#onstartup), não há garantia de que o runtime funcionará neste método, pois a janela está inicializando em um tópico diferente. Se você deseja chamar métodos de tempo de execução na inicialização, use [OnDomReady](../options.mdx#ondomready). + +::: + +A biblioteca Javascript está disponível no frontend através do map `window.runtime`. Há um pacote de runtime gerado ao usar o modo `dev` que fornece declarações de Typescript para o tempo de execução. Isso deve ser localizado no diretório `wailsjs` em seu diretório frontend. + +### Hide + +Go: `Hide(ctx context.Context)`
JS: `Hide()` + +Oculta a aplicação. + +:::info Nota + +No Mac, isto irá ocultar o aplicativo da mesma forma que o `Ocultar` item de menu nos aplicativos padrão Mac. Isso é diferente de esconder a janela, mas a aplicação ainda está em primeiro plano. Para Windows e Linux, atualmente isso é o mesmo que `WindowHide`. + +::: + +### Show + +Mostra a aplicação. + +:::info Nota + +No Mac, a aplicação voltará a ser apresentada em primeiro plano. Para Windows e Linux, atualmente isso é o mesmo que `WindowShow`. + +::: + +Go: `Show(ctx context.Context)`
JS: `Show()` + +### Quit + +Encerra a aplicação. + +Go: `Quit(ctx context.Context)`
JS: `Quit()` + +### Environment + +Retorna detalhes do ambiente atual. + +Go: `Environment(ctx context.Context) EnvironmentInfo`
JS: `Environment(): Promise` + +#### EnvironmentInfo + +Go: + +```go +type EnvironmentInfo struct { + BuildType string + Platform string + Arch string +} +``` + +JS: + +```ts +interface EnvironmentInfo { + buildType: string; + platform: string; + arch: string; +} +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx new file mode 100644 index 00000000..45e721b5 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 3 +--- + +# Registro + +O runtime do Wails fornece um mecanismo de registro que pode ser chamado de Go ou Javascript. Como a maioria dos registros de, há um número de níveis de log: + +- Trace +- Debug +- Info +- Warning +- Erro +- Fatal + +O logger irá gerar qualquer mensagem de log no nível atual, ou superior, de log. Exemplo: O `Debug` log level irá retornar todas as mensagens exceto `Trace` mensagens. + +### LogPrint + +Registra a mensagem dada como uma mensagem "bruta". + +Go: `LogPrint(ctx context.Context, message string)`
JS: `LogPrint(message: string)` + +### LogPrintf + +Registra a mensagem dada como uma mensagem "bruta". + +Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`
+ +### LogTrace + +Registra a mensagem dada no `nível de log`. + +Go: `LogTrace(ctx context.Context, message string)`
JS: `LogTrace(message: string)` + +### LogTracef + +Registra a mensagem dada no `nível de log`. + +Go: `LogTracef(ctx context.Context, format string, args ...interface{})`
+ +### LogDebug + +Registra a mensagem dada no nível de log `Debug`. + +Go: `LogDebug(ctx context.Context, message string)`
JS: `LogDebug(message: string)` + +### LogDebugf + +Registra a mensagem dada no nível de log `Debug`. + +Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`
+ +### LogInfo + +Registra a mensagem dada no nível de log de `Info`. + +Go: `LogInfo(ctx context.Context, message string)`
JS: `LogInfo(message: string)` + +### LogInfof + +Registra a mensagem dada no nível de log de `Info`. + +Go: `LogInfof(ctx context.Context, format string, args ...interface{})`
+ +### LogWarning + +Registra a mensagem dada no nível de log de `Warning`. + +Go: `LogWarning(ctx context.Context, message string)`
JS: `LogWarning(message: string)` + +### LogWarningf + +Registra a mensagem dada no nível de log de `Warning`. + +Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`
+ +### LogError + +Registra a mensagem dada no nível de log de `Error`. + +Go: `LogError(ctx context.Context, message string)`
JS: `LogError(message: string)` + +### LogErrorf + +Registra a mensagem dada no nível de log de `Error`. + +Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`
+ +### LogFatal + +Registra a mensagem dada no nível de log `Fatal`. + +Go: `LogFatal(ctx context.Context, message string)`
JS: `LogFatal(message: string)` + +### LogFatalf + +Registra a mensagem dada no nível de log `Fatal`. + +Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`
+ +### LogSetLogLevel + +Define o nível de log. Em Javascript, o número diz respeito aos seguintes níveis de log: + +| Valor | Nível de Log | +| ----- | ------------ | +| 1 | Trace | +| 2 | Debug | +| 3 | Info | +| 4 | Warning | +| 5 | Erro | + +Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`
JS: `LogSetLogLevel(level: number)` + +## Usando um Logger personalizado + +Um logger personalizado pode ser usado fornecendo usando a opção de aplicativo [Logger](../options.mdx#logger). O único requisito é que o logger implemente a interface de `logger.Logger` definida em `github.com/wailsapp/wails/v2/pkg/logger`: + +```go title="logger.go" +type Logger interface { + Print(message string) + Trace(message string) + Debug(message string) + Info(message string) + Warning(message string) + Error(message string) + Fatal(message string) +} +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx new file mode 100644 index 00000000..924648ca --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx @@ -0,0 +1,25 @@ +--- +sidebar_position: 6 +--- + +# Menus + +Estes métodos estão relacionados ao menu da aplicação. + +:::info Javascript + +O menu não é suportado atualmente no runtime do JS. + +::: + +### MenuSetApplicationMenu + +Define o menu do aplicativo para o [menu](../menus.mdx) fornecido. + +Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)` + +### MenuUpdateApplicationMenu + +Atualiza o menu do aplicativo, pegando qualquer alteração no menu passado para `MenuSetApplicationMenu`. + +Go: `MenuUpdateApplicationMenu(ctx context.Context)` 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 new file mode 100644 index 00000000..2f06c748 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -0,0 +1,221 @@ +--- +sidebar_position: 4 +--- + +# Janela + +Esses métodos dão controle da janela do aplicativo. + +### WindowSetTitle + +Define o texto na barra de título da janela. + +Go: `WindowSetTitle(ctx context.Context, title string)`
JS: `WindowSetTitle(title: string)` + +### WindowFullscreen + +Faz a janela estar em tela cheia. + +Go: `WindowFullscreen(ctx context.Context)`
JS: `WindowFullscreen()` + +### WindowUnfullscreen + +Restaura as dimensões e a posição anteriores da janela antes da tela cheia. + +Go: `WindowUnfullscreen(ctx context.Context)`
JS: `WindowUnfullscreen()` + +### WindowIsFullscreen + +Retorna verdadeiro se a janela estiver em tela cheia. + +Go: `WindowIsFullscreen(ctx context.Context) bool`
JS: `WindowIsFullscreen() bool` + +### WindowCenter + +Centraliza a janela no monitor que a janela está ativada. + +Go: `WindowCenter(ctx context.Context)`
JS: `WindowCenter()` + +### WindowExecJS + +Executa código JS arbitrário na janela. + +Este método executa o código no navegador de forma assíncrona e retorna imediatamente. Se o script causar quaisquer erros, eles só estarão disponíveis no console do navegador. + +Go: `WindowExecJS(ctx context.Context, js string)` + +### WindowReload + +Executa um "recarregar" (Recarrega a página atual). + +Go: `WindowReload(ctx context.Context)`
JS: `WindowReload()` + +### WindowReloadApp + +Recarrega o front-end do aplicativo. + +Go: `WindowReloadApp(ctx context.Context)`
JS: `WindowReloadApp()` + +### WindowSetSystemDefaultTheme + +Somente para Windows. + +Go: `WindowSetSystemDefaultTheme(ctx context.Context)`
JS: `WindowSetSystemDefaultTheme()` + +Define o tema da janela para padrão do sistema (escuro/claro). + +### WindowSetLightTheme + +Somente para Windows. + +Go: `WindowSetLightTheme(ctx context.Context)`
JS: `WindowSetLightTheme()` + +Define o tema da janela como claro. + +### WindowSetDarkTheme + +Somente para Windows. + +Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` + +Define o tema da janela como escuro. + +### WindowShow + +Mostra a janela, se ela estiver oculta no momento. + +Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` + +### WindowHide + +Oculta a janela, se ela estiver visível no momento. + +Go: `WindowHide(ctx context.Context)`
JS: `WindowHide()` + +### WindowIsNormal + +Retorna verdadeiro se a janela não for minimizada, maximizada ou tela inteira. + +Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` + +### WindowSetSize + +Define a largura e a altura da janela. + +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` + +### WindowGetSize + +Obtém a largura e a altura da janela. + +Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `WindowGetSize() : Size` + +### WindowSetMinSize + +Define o tamanho mínimo da janela. Será redimensionada a janela se a janela for atualmente menor do que as dimensões fornecidas. + +Definir um tamanho de `0,0` irá desativar esta restrição. + +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` + +### WindowSetMaxSize + +Define o tamanho máximo da janela. Será redimensionada a janela se a janela for atualmente maior do que as dimensões fornecidas. + +Definir um tamanho de `0,0` irá desativar esta restrição. + +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` + +### WindowSetAlwaysOnTop + +Define a janela sempreOnTop ou não no topo. + +Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlwaysOnTop(b: Boolen)` + +### WindowSetPosition + +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)` + +### WindowGetPosition + +Obtém a posição da janela em relação ao monitor que a janela está ativada. + +Go: `WindowGetPosition(ctx context.Context) (x int, y int)`
JS: `WindowGetPosition() : Position` + +### WindowMaximise + +Maximiza a janela para preencher a tela. + +Go: `WindowMaximise(ctx context.Context)`
JS: `WindowMaximise()` + +### WindowUnmaximise + +Restaurar a janela para as dimensões e a posição antes de maximizar. + +Go: `WindowUnmaximise(ctx context.Context)`
JS: `WindowUnmaximise()` + +### WindowIsMaximised + +Retorna verdadeiro se a janela for maximizada. + +Go: `WindowIsMaximised(ctx context.Context) bool`
JS: `WindowIsMaximised() bool` + +### WindowToggleMaximise + +Alterna entre Maximizado e Não Maximizado. + +Go: `WindowToggleMaximise(ctx context.Context)`
JS: `WindowToggleMaximise()` + +### WindowMinimise + +Minimiza a janela. + +Go: `WindowMinimise(ctx context.Context)`
JS: `WindowMinimise()` + +### WindowUnminimise + +Restaura a janela para as dimensões e a posição antes de minimizar. + +Go: `WindowUnminimise(ctx context.Context)`
JS: `WindowUnminimise()` + +### WindowIsMinimised + +Retorna verdadeiro se a janela estiver minimizada. + +Go: `WindowIsMinimised(ctx context.Context) bool`
JS: `WindowIsMinimised() bool` + +### WindowSetBackgroundColour + +Define a cor de fundo da janela para a definição de cores RGBA fornecida. Esta cor será exibida para todos os pixels transparentes. + +Valores válidos para R, G, B e A são 0-255. + +:::info Windows + +No Windows, apenas valores alfa de 0 ou 255 são suportados. Qualquer valor que não for 0 será considerado 255. + +::: + +Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` + +## Definições de Objetos Typescript + +### Position + +```ts +interface Position { + x: number; + y: number; +} +``` + +### Size + +```ts +interface Size { + w: number; + h: number; +} +``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx b/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx new file mode 100644 index 00000000..1af16f77 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx @@ -0,0 +1,245 @@ +--- +sidebar_position: 20 +--- + +# Dogs API + +```mdx-code-block +
+ +
+
+``` + +:::note + +This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples). + +::: + +In this tutorial we are going to develop an application that retrieves photos of dogs from the web and then displays them. + +### Create the project + +Let's create the application. From a terminal enter: `wails init -n dogs-api -t svelte` + +Note: We could optionally add `-ide vscode` or `-ide goland` to the end of this command if you wanted to add IDE support. + +Now let's `cd dogs-api` and start editing the project files. + +### Remove unused code + +We will start by removing some elements that we know we will not use: + +- Open `app.go` and remove the following lines: + +```go +// Greet returns a greeting for the given name +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s, It's show time!", name) +} +``` + +- Open `frontend/src/App.svelte` and delete all lines. +- Delete the `frontend/src/assets/images/logo-universal.png` file + +### Creating our application + +Now let's add our new Go code. + +Add the following struct declarations to `app.go` before the function definitions: + +```go +type RandomImage struct { + Message string + Status string +} + +type AllBreeds struct { + Message map[string]map[string][]string + Status string +} + +type ImagesByBreed struct { + Message []string + Status string +} +``` + +Add the following functions to `app.go` (perhaps after the existing function definitions): + +```go +func (a *App) GetRandomImageUrl() string { + response, err := http.Get("https://dog.ceo/api/breeds/image/random") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data RandomImage + json.Unmarshal(responseData, &data) + + return data.Message +} + +func (a *App) GetBreedList() []string { + var breeds []string + + response, err := http.Get("https://dog.ceo/api/breeds/list/all") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data AllBreeds + json.Unmarshal(responseData, &data) + + for k := range data.Message { + breeds = append(breeds, k) + } + + sort.Strings(breeds) + + return breeds +} + +func (a *App) GetImageUrlsByBreed(breed string) []string { + + url := fmt.Sprintf("%s%s%s%s", "https://dog.ceo/api/", "breed/", breed, "/images") + response, err := http.Get(url) + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data ImagesByBreed + json.Unmarshal(responseData, &data) + + return data.Message +} +``` + +Modify the `import` section of `app.go` to look like this: + +```go +import ( + "context" + "fmt" + "encoding/json" + "io/ioutil" + "log" + "net/http" + "sort" +) +``` + +Add the following lines to `frontend/src/App.svelte`: + + +```html + + +

Dogs API

+
+ + Click on down arrow to select a breed + + +
+
+{#if showRandomPhoto} + No dog found +{/if} +{#if showBreedPhotos} + {#each photos as photo} + No dog found + {/each} +{/if} + + +``` + + +### Testing the application + +To generate the bindings and test the application, run `wails dev`. + +### Compiling the application + +To compile the application to a single, production grade binary, run `wails build`. 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 new file mode 100644 index 00000000..b783461d --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -0,0 +1,122 @@ +--- +sidebar_position: 10 +--- + +# Hello World + +The aim of this tutorial is to get you up and running with the most basic application using Wails. You will be able to: + +- Create a new Wails application +- Build the application +- Run the application + +:::note + +This tutorial uses Windows as the target platform. Output will vary slightly depending on your operating system. + +::: + +## Create a new Wails application + +To create a new Wails application using the default vanilla JS template, you need to run the following command: + +```bash +wails init -n helloworld +``` + +You should see something similar to the following: + +``` +Wails CLI v2.0.0 + +Initialising Project 'helloworld' +--------------------------------- + +Project Name: helloworld +Project Directory: C:\Users\leaan\tutorial\helloworld +Project Template: vanilla +Template Support: https://wails.io + +Initialised project 'helloworld' in 232ms. +``` + +This will create a new directory called `helloworld` in the current directory. In this directory, you will find a number of files: + +``` +build/ - Contains the build files + compiled application +frontend/ - Contains the frontend files +app.go - Contains the application code +main.go - The main program with the application configuration +wails.json - The project configuration file +go.mod - The go module file +go.sum - The go module checksum file +``` + +## Build the application + +To build the application, change to the new `helloworld` project directory and run the following command: + +```bash +wails build +``` + +You should see something like the following: + +``` +Wails CLI v2.0.0 + +App Type: desktop +Platforms: windows/amd64 +Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe +Build Mode: Production +Skip Frontend: false +Compress: false +Package: true +Clean Build Dir: false +LDFlags: "" +Tags: [] +Race Detector: false + +Building target: windows/amd64 +------------------------------ + - Installing frontend dependencies: Done. + - Compiling frontend: Done. + - Generating bundle assets: Done. + - Compiling application: Done. +Built 'C:\Users\leaan\tutorial\helloworld\build\bin\helloworld.exe' in 10.616s. +``` + +This has compiled the application and saved it in the `build/bin` directory. + +## Run the application + +If we view the `build/bin` directory in Windows Explorer, we should see our project binary: + +```mdx-code-block +
+ +
+
+``` + +We can run it by simply double-clicking the `helloworld.exe` file. + +On Mac, Wails generates a `helloworld.app` file which can be run by double-clicking it. + +On Linux, you can run the application using `./helloworld` from the `build/bin` directory. + +You should see the application working as expected: + +```mdx-code-block +
+ +
+
+``` diff --git a/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json new file mode 100644 index 00000000..131be071 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.0.0-rc.1", + "description": "The label for version v2.0.0-rc.1" + }, + "sidebar.docs.category.Getting Started": { + "message": "Guia de Introdução", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Referências", + "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": "Comunidade", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Demonstração", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guias", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contribuição", + "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-docs/version-v2.0.0.json b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.0.0.json new file mode 100644 index 00000000..ffabd9b6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.0.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.0.0", + "description": "The label for version v2.0.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Guia de Introdução", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Referências", + "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": "Comunidade", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Demonstração", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guias", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contribuição", + "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-docs/version-v2.1.0.json b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.1.0.json new file mode 100644 index 00000000..be799723 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.1.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.1.0", + "description": "The label for version v2.1.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Guia de Introdução", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Referências", + "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": "Comunidade", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Demonstração", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guias", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contribuição", + "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-docs/version-v2.2.0.json b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.2.0.json new file mode 100644 index 00000000..c6a01669 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-docs/version-v2.2.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.2.0", + "description": "The label for version v2.2.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Guia de Introdução", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Referências", + "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": "Comunidade", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Demonstração", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Guias", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Contribuição", + "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 new file mode 100644 index 00000000..a35e7850 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/changelog.mdx @@ -0,0 +1,570 @@ +# Registo de alterações + +Todas as alterações notáveis para este projeto serão documentadas neste arquivo. + +O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.com/en/1.0.0/), e este projeto adere à [Versão Semântica](https://semver.org/spec/v2.0.0.html). + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +## [Unreleased] + +### Adicionado +- Added `OpenInspectorOnStartup` to debug options to allow opening the WebInspector during startup of the application in debug mode. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2080) +- On macOS `wails doctor` now also shows the version of Xcode installed. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2089) +- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091) + +### Corrigido +- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081) +- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103) + +## v2.2.0 - 2022-11-09 + +### Adicionado + +- Wails now uses a purpose built, native Go implementation of Microsoft's webview2loader dll. This means there is no need to embed the `Webview2Loader.dll` file in your binaries, meaning filesizes will be ~130k smaller! Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/1974)! +- This release provides much more control over custom asset handling via the new [AssetServer](https://wails.io/docs/reference/options#assetserver) options. This allows you to provide your own custom asset handler and hook into the request chain through middleware. Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/2016) and @mholt for the [initial idea](https://github.com/wailsapp/wails/issues/2007) and extensive testing. +- It is now possible to customise the layout of your Wails projects using 2 new options in `wails.json`: + - `build:dir` can be used to specify where the build files reside + - `frontend:dir` can be used to specify where the frontend files reside + - If `go.mod` is not found in the same directory as `wails.json`, the cli will look up the parent directories to find it. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2009) +- Colour output in the CLI can now be turned off by using the `--nocolor` flag. This is useful for CI/CD pipelines. Thanks to @scottopell for the [PR](https://github.com/wailsapp/wails/pull/1947) +- A JSON schema definition for the `wails.json` file has been added. IDEs should now provide code complete when editing `wails.json`. Thanks to @binyamin for the [PR](https://github.com/wailsapp/wails/pull/1864) +- The `EventsOn*` methods now return a function that can be called to deregister the listener. Thanks to @joshbuddy for the [PR](https://github.com/wailsapp/wails/pull/1969) + +### Corrigido + +- Webview2 on Windows returns a potential whitespace when defining the style like this style="--wails-draggable: drag". Fixed by @stffabi in https://github.com/wailsapp/wails/pull/1989 +- Bound structs that had `struct{}` field types would cause the Typescript generation to fail. Thanks to @ParkourLiu for the [PR](https://github.com/wailsapp/wails/pull/1999) +- When maximising a frameless window on Windows with multiple monitors, the window could sometimes become blank. Thanks to @stffabi for the [fix](https://github.com/wailsapp/wails/pull/2043) + +### Alterado + +- The troubleshooting guide was updated to provide guidance when [Vite fails to start](https://wails.io/docs/guides/troubleshooting#cannot-start-service-host-version-xxx-does-not-match-binary-version-xxx). Thanks to @willdot for the [PR](https://github.com/wailsapp/wails/pull/2000). +- English, Chinese and Japanese documentation updates. Thanks to @misitebao. + +### Obsoleto + +- The [AssetsHandler](https://wails.io/docs/reference/options#assetshandler) option has been deprecated. Please use the [AssetServer](https://wails.io/docs/reference/options#assetserver) option instead. + +### Novos Contribuidores + +- @willdot made their first contribution in https://github.com/wailsapp/wails/pull/2000 +- @ParkourLiu made their first contribution in https://github.com/wailsapp/wails/pull/1999 +- @binyamin made their first contribution in https://github.com/wailsapp/wails/pull/1864 +- @joshbuddy made their first contribution in https://github.com/wailsapp/wails/pull/1969 +- @sgosiaco made their first contribution in https://github.com/wailsapp/wails/pull/2062 + +## v2.1.0 - 2022-10-18 + +### Removed + +- The `RGBA` option in `options.App` has now been removed. Use `BackgroundColour` instead. + +### Adicionado + +- [Suporte para definir o padrão como Nenhum botão em diálogos Windows](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony em https://github.com/wailsapp/wails/pull/1875 +- Adicionar redimensionamento ausente para uma janela sem frameless no Linux - @Lyimmi em https://github.com/wailsapp/wails/pull/1918 +- [Adicione transparência da janela para linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi em https://github.com/wailsapp/wails/pull/1926 +- [Adicionar método WindowExecJS](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony em https://github.com/wailsapp/wails/pull/1927 +- [Adicione suporte para `Info.dev.plist` no macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony em https://github.com/wailsapp/wails/pull/1960 +- [Adicione ZoomFactor get/set e adicione as respectivas opções exclusivas](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye em https://github.com/wailsapp/wails/pull/1463 + +### Corrigido + +- Diretórios embutidos criados automaticamente se eles não existirem - @leaanthony em https://github.com/wailsapp/wails/pull/1983 +- Cite os argumentos dos comandos se eles tiverem um espaço - @leaanthony em https://github.com/wailsapp/wails/pull/1892 +- Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916 +- Fix gtk_window_begin_resize_drag's mouse - @Lyimmi em https://github.com/wailsapp/wails/pull/1920 +- Corrigir casos especiais de geração de ligação - @JulioDRF em https://github.com/wailsapp/wails/pull/1902 +- Remova o diretório `.git` no template - @misitebao em https://github.com/wailsapp/wails/pull/1929 +- Corrigir wails dev - @JulioDRF em https://github.com/wailsapp/wails/pull/1931 +- Correção para considerar novos `go` arquivos no observador do sistema de arquivos de desenvolvimento - @scottopell em https://github.com/wailsapp/wails/pull/1946 +- Impeça a análise de tipos para interferir com o nome do pacote Typescript - @ValentinTrinque em https://github.com/wailsapp/wails/pull/1942 +- [dev] Não tente infer assetdir from fs.FS quando um servidor de desenvolvimento de frontend estiver em uso - @stffabi em https://github.com/wailsapp/wails/pull/1972 +- Corrigir fix init não listado em wails help message - @lyon-lee-dev em https://github.com/wailsapp/wails/pull/1976 + +### Alterado + +- Adicione verificações de PR - @leaanthony em https://github.com/wailsapp/wails/pull/1879 +- Auto label cards de projeto - @leaanthony em https://github.com/wailsapp/wails/pull/1881 +- Adicione tradutor de issue - @leaanthony em https://github.com/wailsapp/wails/pull/1891 +- Atualize os rótulos de nomes no modelo de issue - @misitebao em https://github.com/wailsapp/wails/pull/1893 +- ofuscado em vez de ofuscar na documentação - @arifali123 em https://github.com/wailsapp/wails/pull/1895 +- [assetHandler] Remover prefixo do log redundante - @stffabi em https://github.com/wailsapp/wails/pull/1896 +- [dev] Não gera ligações no próprio aplicativo de desenvolvimento - @stffabi em https://github.com/wailsapp/wails/pull/1899 +- Atualizar tradução em chinês - @almas1992 em https://github.com/wailsapp/wails/pull/1894 +- Adicione verificações de Pr - @leaanthony em https://github.com/wailsapp/wails/pull/1909 +- Atualize documentos - @misitebao em https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936 +- Adicionando o link Tutorial - @raguay em https://github.com/wailsapp/wails/pull/1903 +- Adicione o modelo react-ts-vite-tailwind - @hotafrika em https://github.com/wailsapp/wails/pull/1930 +- Atualize README.zh-Hans.md - @o8x em https://github.com/wailsapp/wails/pull/1949 +- Adicione modelo de comunidade CSS Elm Tailwind - @rnice01 em https://github.com/wailsapp/wails/pull/1939 +- Adicione tradutor de issue - @leaanthony em https://github.com/wailsapp/wails/pull/1965 +- Adicione verificações de Pr - @leaanthony em https://github.com/wailsapp/wails/pull/1966 +- Adicione verificações de Pr - @leaanthony em https://github.com/wailsapp/wails/pull/1966 +- Atualizar Imagem de Patrocinador - @github-actions em https://github.com/wailsapp/wails/pull/1973 +- documentos: sincronize documentos - @misitebao em https://github.com/wailsapp/wails/pull/1968 +- Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979 + +### Novos Contribuidores + +- @arifali123 fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1895 +- @almas1992 fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1894 +- @JulioDRF fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1902 +- @hotafrika fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1930 +- @scottopell foi sua primeira contribuição em https://github.com/wailsapp/wails/pull/1946 +- @o8x fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1949 +- @rnice01 fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1939 +- @cuigege fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1979 +- @lyon-lee-dev fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1976 + +## v2.0.0 - 2022-09-22 + +### Corrigido + +- Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858 +- Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862 + +### Alterado + +- Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854 +- Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853 +- chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848 +- Update introduction.mdx by @ParvinEyvazov in https://github.com/wailsapp/wails/pull/1863 +- Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869 +- Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849 + +### Novos Contribuidores + +- @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863 + +## v2.0.0-rc.1 - 2022-09-13 + +### Obsoleto + +- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command. + +### Adicionado + +- Add garble support by @leaanthony in https://github.com/wailsapp/wails/pull/1793 +- Make draggable CSS property customisable by @leaanthony in https://github.com/wailsapp/wails/pull/1828 +- Add Some WindowState by @zandercodes in https://github.com/wailsapp/wails/pull/1349 +- Make EventsOff capable of removing multiple listeners by @Lyimmi in https://github.com/wailsapp/wails/pull/1822 + +### Corrigido + +- Use `Promise` when Go routine does not output by @SheetJSDev in https://github.com/wailsapp/wails/pull/1821 +- preact-ts template build fix by @Debdut in https://github.com/wailsapp/wails/pull/1781 +- fix frontend/tsconfig.js by @Lyimmi in https://github.com/wailsapp/wails/pull/1795 +- fix: fix bugs in website by @misitebao in https://github.com/wailsapp/wails/pull/1810 +- Fix vue-ts template by @leaanthony in https://github.com/wailsapp/wails/pull/1813 +- Remove duplicate defs in win32/window.go by @AlbinoDrought in https://github.com/wailsapp/wails/pull/1832 + +### Alterado + +- Upgrade React to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1744 +- Upgrade Lit to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1745 +- Support vite3 for Vue by @leaanthony in https://github.com/wailsapp/wails/pull/1746 +- Preact templates for vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1770 +- Prevent env variables and registry overrides from changing behaviour by @stffabi in https://github.com/wailsapp/wails/pull/1771 +- Use go implementation to retrieve the version of a fixed runtime by @stffabi in https://github.com/wailsapp/wails/pull/1790 +- Change contribution guide type from "doc" to "page" by @misitebao in https://github.com/wailsapp/wails/pull/1777 +- feat(website): repair document content by @misitebao in https://github.com/wailsapp/wails/pull/1775 +- chore: sort out files by @misitebao in https://github.com/wailsapp/wails/pull/1776 +- Add Korean to doc by @jaesung9507 in https://github.com/wailsapp/wails/pull/1774 +- Add README.ja.md by @shinshin86 in https://github.com/wailsapp/wails/pull/1783 +- Reorganized contribution guidelines page by @misitebao in https://github.com/wailsapp/wails/pull/1784 +- fix(website): fix link by @misitebao in https://github.com/wailsapp/wails/pull/1785 +- Update templates.mdx by @KiddoV in https://github.com/wailsapp/wails/pull/1799 +- Better watcher by @leaanthony in https://github.com/wailsapp/wails/pull/1827 +- Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" by @prurigro in https://github.com/wailsapp/wails/pull/1811 +- Optimize images by @imgbot in https://github.com/wailsapp/wails/pull/1812 + +### Novos Contribuidores + +- @shinshin86 made their first contribution in https://github.com/wailsapp/wails/pull/1783 +- @Debdut made their first contribution in https://github.com/wailsapp/wails/pull/1781 +- @KiddoV made their first contribution in https://github.com/wailsapp/wails/pull/1799 +- @zandercodes made their first contribution in https://github.com/wailsapp/wails/pull/1349 +- @prurigro made their first contribution in https://github.com/wailsapp/wails/pull/1811 +- @SheetJSDev made their first contribution in https://github.com/wailsapp/wails/pull/1821 +- @AlbinoDrought made their first contribution in https://github.com/wailsapp/wails/pull/1832 +- @imgbot made their first contribution in https://github.com/wailsapp/wails/pull/1812 + +## v2.0.0-beta.44 - 2022-08-20 + +### Obsoleto + +The `data-wails-drag` attribute is being deprecated in favour of the following CSS style: `style="--wails-draggable:drag"`. You can use `style="--wails-draggable:no-drag"` to disable the drag behaviour. For this release only, you can test this by setting the following application option: + +```go +Experimental: &options.Experimental{ + UseCSSDrag: true, +}, +``` + +### Adicionado + +- Set file permissions for generated files by @leaanthony in https://github.com/wailsapp/wails/pull/1763 +- Experimental support for CSS Drag detection by @leaanthony in https://github.com/wailsapp/wails/pull/1750 + +### Corrigido + +- Bug fix collecting of output binaries for platforms by @stffabi in https://github.com/wailsapp/wails/pull/1715 +- Fix registration of exposed fields by @ValentinTrinque in https://github.com/wailsapp/wails/pull/1727 +- Fix column widths for doctor command's dependencies table by @ianmjones in https://github.com/wailsapp/wails/pull/1717 +- Do not generate bindings for `OnBeforeClose` method + +### Alterado + +- Misc code refactors and removal by @leaanthony in https://github.com/wailsapp/wails/pull/1713 +- Add react-router to routing.mdx by @Maicarons2022 in https://github.com/wailsapp/wails/pull/1755 +- Add Japanese to doc by @RyoTagami in https://github.com/wailsapp/wails/pull/1716 +- Added EmailIt and Modal File Manager by @raguay in https://github.com/wailsapp/wails/pull/1728 +- Adding my ScriptBar program by @raguay in https://github.com/wailsapp/wails/pull/1761 +- Link to general webview2 runtime download page and not to a specific language by @stffabi in https://github.com/wailsapp/wails/pull/1764 +- Updated translations in https://github.com/wailsapp/wails/pull/1719 and https://github.com/wailsapp/wails/pull/1720 +- Remove text outside style's brackets by @DragoSpiro98 in https://github.com/wailsapp/wails/pull/1765 + +### Novos Contribuidores + +- @RyoTagami made their first contribution in https://github.com/wailsapp/wails/pull/1716 +- @raguay made their first contribution in https://github.com/wailsapp/wails/pull/1728 +- @Maicarons2022 made their first contribution in https://github.com/wailsapp/wails/pull/1755 +- @DragoSpiro98 made their first contribution in https://github.com/wailsapp/wails/pull/1765 + +## v2.0.0-beta.43 - 2022-08-08 + +### Adicionado + +- Add support for retrieving the release notes from Github by @leaanthony in https://github.com/wailsapp/wails/pull/1679 +- Add `frontend:dev:install` configuration by @LGiki in https://github.com/wailsapp/wails/pull/1666 + +### Corrigido + +- Fix formatting of some error messages by @stffabi in https://github.com/wailsapp/wails/pull/1665 +- Windows dialogs now work when window is not visible yet by @leaanthony in https://github.com/wailsapp/wails/pull/1662 +- Multiple fixes for MacOS asset requests by @stffabi in https://github.com/wailsapp/wails/pull/1668 and https://github.com/wailsapp/wails/pull/1681 +- Fix for Go 1.19 by @stffabi in https://github.com/wailsapp/wails/pull/1689 +- Removed Linux warnings by @leaanthony in https://github.com/wailsapp/wails/pull/1656 +- Better support for doubleclick events in drag regions by @leaanthony in https://github.com/wailsapp/wails/pull/1704 +- Allow MacOS frameless window to be miniturisable by @leaanthony in https://github.com/wailsapp/wails/pull/1705 + +### Alterado + +- add wails-sveltekit-template by @h8gi in https://github.com/wailsapp/wails/pull/1671 +- wails doctor now reports correct MacOS os id by @stffabi in https://github.com/wailsapp/wails/pull/1673 +- Update application-development.mdx by @SamHennessy in https://github.com/wailsapp/wails/pull/1682 +- Move SetMin/Max calls to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1684 +- Change `frontend:dev` to `frontend:dev:build` by @LGiki in https://github.com/wailsapp/wails/pull/1691 +- Build frontend only before starting the dev watcher command by @stffabi in https://github.com/wailsapp/wails/pull/1694 +- Improve error message for auto dev server discovery without a dev watcher by @stffabi in https://github.com/wailsapp/wails/pull/1711 + +### Novos Contribuidores + +- @h8gi made their first contribution in https://github.com/wailsapp/wails/pull/1671 +- @SamHennessy made their first contribution in https://github.com/wailsapp/wails/pull/1682 + +## v2.0.0-beta.42 - 2022-07-25 + +### Adicionado + +- Added `options.NewRGBA` and `options.NewRGB` functions to create `*options.RGBA` by @leaanthony + +### Corrigido + +- Fixed initial build of frontend when using `wails dev` on new projects by @leaanthony in https://github.com/wailsapp/wails/pull/1650 +- Ignore empty install command when running `wails dev` by @stffabi in https://github.com/wailsapp/wails/pull/1651 +- Fixed error reporting in templates +- BackgroundColour documentation fix +- Generalize manual compile steps [Documentation] by @acheong08 in https://github.com/wailsapp/wails/pull/1644 + +## v2.0.0-beta.40 - 2022-07-24 + +### Adicionado + +- Adicionar Show() e Hide() ao tempo de execução para mostrar/ocultar aplicativo de @leaanthony em https://github.com/wailsapp/wails/pull/1599 +- Sobrescreva a plataforma/arca alvo usando as variáveis de ambiente GOOS e GOARCH por @leaanthony em https://github.com/wailsapp/wails/pull/1618 +- Adicionada uma opção para pular a reconstrução frontend no modo dev, por @leaanthony em https://github.com/wailsapp/wails/pull/1632 + +### Corrigido + +- Atualize os modelos de svelte para usar vite 3 por @leaanthony em https://github.com/wailsapp/wails/pull/1643 +- Corrigido modelo simples por @stffabi em https://github.com/wailsapp/wails/pull/1609 +- Corrigir o layout do site por @leaanthony em https://github.com/wailsapp/wails/pull/1616 +- Corrigido erro de digitação na página de documentação docs/howdoesitwork by @MyNameIsAres em https://github.com/wailsapp/wails/pull/1636 +- Uso de dimensionamento na janela min/max por @leaanthony em https://github.com/wailsapp/wails/pull/1557 + +### Alterado + +- Instalar dependências de desenvolvimento antes de iniciar o modo de desenvolvimento por @leaanthony em https://github.com/wailsapp/wails/pull/1615 +- Traduzido e corrijido o texto do site por @misitebao em https://github.com/wailsapp/wails/pull/1525 +- docs: adicionado MyNameIsAres como colaborador do doc por @allcontributors em https://github.com/wailsapp/wails/pull/1638 +- Obsoleto o appoption do Fullscreen por @acheong08 em https://github.com/wailsapp/wails/pull/1640 + +### Obsoleto + +- A opção do aplicativo `Tela Inteira` está descontinuada. Por favor use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) em vez disso. + +### Novos Contribuidores + +- @MyNameIsAres fez sua primeira contribuição em https://github.com/wailsapp/wails/pull/1636 + +## v2.0.0-beta.39.2 - 2022-07-20 + +### Adicionado + +- Exemplo de atualização para o Menu do MacOS por @acheong08 em https://github.com/wailsapp/wails/pull/1600 + +### Corrigido + +- Reinstate Go 1.17 compatibility by @leaanthony in https://github.com/wailsapp/wails/pull/1605 + +## v2.0.0-beta.39 - 2022-07-19 + +### Adicionado + +- Novas dimensões da API de tela por @skamensky em https://github.com/wailsapp/wails/pull/1519 +- Descubra automaticamente a porta do devserver vite por @leaanthony em https://github.com/wailsapp/wails/pull/1547 +- Adicione suporte de nixpkgs no doctor. by @ianmjones in https://github.com/wailsapp/wails/pull/1551 +- Novo recurso de pré-compilação hooks de @leaanthony em https://github.com/wailsapp/wails/pull/1578 +- Nova opção de nível de log de produção de @leaanthony em https://github.com/wailsapp/wails/pull/1555 + +### Corrigido + +- Corrigir corrupção de stack no Windows quando estiver usando o ICoreWebView2HttpHeadersCollectionIterator por @stffabi em https://github.com/wailsapp/wails/pull/1589 +- Movido o WindowGet\* para o tópico principal de @leaanthony em https://github.com/wailsapp/wails/pull/1464 +- Permitir que a flag -appargs passe flags para binário. por @ianmjones em https://github.com/wailsapp/wails/pull/1534 +- Corrigir verificação de pacote apt instalado em nenhuma sessão em inglês. por @ianmjones em https://github.com/wailsapp/wails/pull/1548 +- Fix OnBeforeClose código para Mac por @leaanthony em https://github.com/wailsapp/wails/pull/1558 +- Conversão de Mapas em TS por @leaanthony em https://github.com/wailsapp/wails/pull/1435 +- Verifique o comprimento da linha ao escanear por Url local do devserver por @leaanthony em https://github.com/wailsapp/wails/pull/1566 +- Remova o uso de unsafe.Pointer no winc por @stffabi e @leaanthony em https://github.com/wailsapp/wails/pull/1556 + +### Alterado + +- Renomeie WindowSetRGBA -> WindowSetBackgroundColour por @leaanthony em https://github.com/wailsapp/wails/pull/1506 +- Melhorias no comando dev pelo @stffabi em https://github.com/wailsapp/wails/pull/1510 +- Atualize o template vscode por @leaanthony em https://github.com/wailsapp/wails/pull/1398 +- Aumentar svelte de 3.42.2 a 3.49.0 em /v2/interno/frontend/runtime/dev por @dependabot em https://github.com/wailsapp/wails/pull/1572 +- Subir svelte de 3.42.5 a 3.49.0 em /v2/interno/frontend/runtime por @dependabot em https://github.com/wailsapp/wails/pull/1573 +- Adicionar solução de problemas para `Não encontrado erro` por @acheong08 em https://github.com/wailsapp/wails/pull/1586 +- Documentos/melhores páginas da @leaanthony em https://github.com/wailsapp/wails/pull/1591 + +### Novos Contribuidores + +- @skamensky made their first contribution in https://github.com/wailsapp/wails/pull/1519 +- @acheong08 made their first contribution in https://github.com/wailsapp/wails/pull/1586 + +**Full Changelog**: https://github.com/wailsapp/wails/compare/v2.0.0-beta.38...v2.0.0-beta.39 + +## v2.0.0-beta.38 - 2022-06-27 + +### Adicionado + +- Add race detector to build & dev by @Lyimmi in https://github.com/wailsapp/wails/pull/1426 +- [linux] Support `linux/arm` architecture by @Lyimmi in https://github.com/wailsapp/wails/pull/1427 +- Create gitignore when using `-g` option by @jaesung9507 in https://github.com/wailsapp/wails/pull/1430 +- [windows] Add Suspend/Resume callback support by @leaanthony in https://github.com/wailsapp/wails/pull/1474 +- Add runtime function `WindowSetAlwaysOnTop` by @chenxiao1990 in https://github.com/wailsapp/wails/pull/1442 +- [windows] Allow setting browser path by @NanoNik in https://github.com/wailsapp/wails/pull/1448 + +### Corrigido + +- [linux] Improve switching to main thread for callbacks by @stffabi in https://github.com/wailsapp/wails/pull/1392 +- [windows] Fix WebView2 minimum runtime version check by @stffabi in https://github.com/wailsapp/wails/pull/1456 +- [linux] Fix apt command syntax (#1458) by @abtin in https://github.com/wailsapp/wails/pull/1461 +- [windows] Set Window Background colour if provided + debounce redraw option by @leaanthony in https://github.com/wailsapp/wails/pull/1466 +- Fix small typo in docs by @LukenSkyne in https://github.com/wailsapp/wails/pull/1449 +- Fix the url to surge by @andywenk in https://github.com/wailsapp/wails/pull/1460 +- Fixed theme change at runtime by @leaanthony in https://github.com/wailsapp/wails/pull/1473 +- Fix: Don't stop if unable to remove temporary bindings build by @leaanthony in https://github.com/wailsapp/wails/pull/1465 +- [windows] Pass the correct installationStatus to the webview installation strategy by @stffabi in https://github.com/wailsapp/wails/pull/1483 +- [windows] Make `SetBackgroundColour` compatible for `windows/386` by @stffabi in https://github.com/wailsapp/wails/pull/1493 +- Fix lit-ts template by @Orijhins in https://github.com/wailsapp/wails/pull/1494 + +### Alterado + +- [windows] Load WebView2 loader from embedded only by @stffabi in https://github.com/wailsapp/wails/pull/1432 +- Add showcase entry for October + update homepage carousel entry for October by @marcus-crane in https://github.com/wailsapp/wails/pull/1436 +- Always use return in wrapped method by @leaanthony in https://github.com/wailsapp/wails/pull/1410 +- [windows] Unlock OSThread after native calls have been finished by @stffabi in https://github.com/wailsapp/wails/pull/1441 +- Add `BackgroundColour` and deprecate `RGBA` by @leaanthony in https://github.com/wailsapp/wails/pull/1475 +- AssetsHandler remove retry logic in dev mode by @stffabi in https://github.com/wailsapp/wails/pull/1479 +- Add Solid JS template to docs by @sidwebworks in https://github.com/wailsapp/wails/pull/1492 +- Better signal handling by @leaanthony in https://github.com/wailsapp/wails/pull/1488 +- Chore/react 18 create root by @tomanagle in https://github.com/wailsapp/wails/pull/1489 + +### Novos Contribuidores + +- @jaesung9507 made their first contribution in https://github.com/wailsapp/wails/pull/1430 +- @LukenSkyne made their first contribution in https://github.com/wailsapp/wails/pull/1449 +- @andywenk made their first contribution in https://github.com/wailsapp/wails/pull/1460 +- @abtin made their first contribution in https://github.com/wailsapp/wails/pull/1461 +- @chenxiao1990 made their first contribution in https://github.com/wailsapp/wails/pull/1442 +- @NanoNik made their first contribution in https://github.com/wailsapp/wails/pull/1448 +- @sidwebworks made their first contribution in https://github.com/wailsapp/wails/pull/1492 +- @tomanagle made their first contribution in https://github.com/wailsapp/wails/pull/1489 + +## v2.0.0-beta.37 - 2022-05-26 + +### Adicionado + +- Add `nogen` flag in wails dev command by @mondy in https://github.com/wailsapp/wails/pull/1413 +- Initial support for new native translucency in Windows Preview by @leaanthony in https://github.com/wailsapp/wails/pull/1400 + +### Corrigido + +- Bugfix/incorrect bindings by @leaanthony in https://github.com/wailsapp/wails/pull/1383 +- Fix runtime.js events by @polikow in https://github.com/wailsapp/wails/pull/1369 +- Fix docs formatting by @antimatter96 in https://github.com/wailsapp/wails/pull/1372 +- Events | fixes #1388 by @lambdajack in https://github.com/wailsapp/wails/pull/1390 +- bugfix: correct typo by @tmclane in https://github.com/wailsapp/wails/pull/1391 +- Fix typo in docs by @LGiki in https://github.com/wailsapp/wails/pull/1393 +- Fix typo bindings.js to ipc.js by @rayshoo in https://github.com/wailsapp/wails/pull/1406 +- Make sure to execute the menu callbacks on a new goroutine by @stffabi in https://github.com/wailsapp/wails/pull/1403 +- Update runtime.d.ts & templates by @Yz4230 in https://github.com/wailsapp/wails/pull/1421 +- Add missing className to input in React and Preact templates by @edwardbrowncross in https://github.com/wailsapp/wails/pull/1419 + +### Alterado + +- Improve multi-platform builds by @stffabi in https://github.com/wailsapp/wails/pull/1373 +- During wails dev only use reload logic if no AssetsHandler are in use by @stffabi in https://github.com/wailsapp/wails/pull/1385 +- Update events.mdx by @Junkher in https://github.com/wailsapp/wails/pull/1387 +- Add Next.js template by @LGiki in https://github.com/wailsapp/wails/pull/1394 +- Add docs on wails generate module by @TechplexEngineer in https://github.com/wailsapp/wails/pull/1414 +- Add macos custom menu EditMenu tips by @daodao97 in https://github.com/wailsapp/wails/pull/1423 + +### Novos Contribuidores + +- @polikow made their first contribution in https://github.com/wailsapp/wails/pull/1369 +- @antimatter96 made their first contribution in https://github.com/wailsapp/wails/pull/1372 +- @Junkher made their first contribution in https://github.com/wailsapp/wails/pull/1387 +- @lambdajack made their first contribution in https://github.com/wailsapp/wails/pull/1390 +- @LGiki made their first contribution in https://github.com/wailsapp/wails/pull/1393 +- @rayshoo made their first contribution in https://github.com/wailsapp/wails/pull/1406 +- @TechplexEngineer made their first contribution in https://github.com/wailsapp/wails/pull/1414 +- @mondy made their first contribution in https://github.com/wailsapp/wails/pull/1413 +- @Yz4230 made their first contribution in https://github.com/wailsapp/wails/pull/1421 +- @daodao97 made their first contribution in https://github.com/wailsapp/wails/pull/1423 +- @edwardbrowncross made their first contribution in https://github.com/wailsapp/wails/pull/1419 + +## v2.0.0-beta.36 - 2022-04-27 + +### Corrigido + +- [v2] Validate devServer property to be of the correct form by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1359 +- [v2, darwin] Initialize native variables on stack to prevent segfault by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1362 +- Vue-TS template fix + +### Alterado + +- Added `OnStartup` method back to default templates + +## v2.0.0-beta.35 - 2022-04-27 + +### Grandes Alterações + +- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324) +- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) + +### Adicionado + +- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info. +- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`! +- Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi) +- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows. +- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript) +- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi) +- Added docs for [code-signing](https://wails.io/docs/guides/signing) and [NSIS installer](https://wails.io/docs/guides/windows-installer) - [@gardc](https://github.com/gardc) +- Add support for `-trimpath` [build flag](https://wails.io/docs/reference/cli#build) +- Add support for a default AssetsHandler - [@stffabi](https://github.com/stffabi) + +### Corrigido + +- Improved mimetype detection for BOM marker and comments - [@napalu](https://github.com/napalu) +- Remove duplicate mimetype entries - [@napalu](https://github.com/napalu) +- Remove duplicate Typescript imports in generated definition files - [@adalessa](https://github.com/adalessa) +- Add missing method declaration - [@adalessa](https://github.com/adalessa) +- Fix Linux sigabrt on start - [@napalu](https://github.com/napalu) +- Double Click event now works on elements with `data-wails-drag` attribute - [@jicg](https://github.com/jicg) +- Suppress resizing during minimize of a frameless window - [@stffabi](https://github.com/stffabi) +- Fixed TS/JS generation for Go methods with no returns +- Fixed WailsJS being generated in project directory + +### Alterado + +- Website docs are now versioned +- Improved `runtime.Environment` call +- Improve the close action for Mac +- A bunch of dependabot security updates +- Improved website content - [@misitebao](https://github.com/misitebao) +- Upgrade issue template - [@misitebao](https://github.com/misitebao) +- Convert documents that don't require version management to individual pages + - [@misitebao](https://github.com/misitebao) +- Website now using Algolia search + +## v2.0.0-beta.34 - 2022-03-26 + +### Adicionado + +- Add support for 'DomReady' callback on linux by [@napalu](https://github.com/napalu) in #1249 +- MacOS - Show extension by default by [@leaanthony](https://github.com/leaanthony) in #1228 + +### Corrigido + +- [v2, nsis] Seems like / as path separator works only for some directives in a cross platform way by [@stffabi](https://github.com/stffabi) in #1227 +- import models on binding definition by [@adalessa](https://github.com/adalessa) in #123 + + 1 + +- Use local search on website by [@leaanthony](https://github.com/leaanthony) in #1234 +- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240 +- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241 +- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243 +- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245 +- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230 +- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247 +- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258 +- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255 +- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257 +- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212 +- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180 + +### Alterado + +- feat(website): sincronize documentos e adicione conteúdo por [@misitebao](https://github.com/misitebao) em #1215 +- refator(cli): otimizar templates padrão por [@misitebao](https://github.com/misitebao) em #1214 +- Execute o observador após a compilação inicial por [@leaanthony](https://github.com/leaanthony) em #1216 +- Atualização de recursos/documentos por [@leaanthony](https://github.com/leaanthony) em #1218 +- feat(website): otimize o site e sincronize documentos por [@misitebao](https://github.com/misitebao) em #1219 +- documentos: sincronize documentos por [@misitebao](https://github.com/misitebao) em #1224 +- Página de índice padrão por [@leaanthony](https://github.com/leaanthony) em #1229 +- Compatibilidade com win32 adicionada por [@fengweiqiang](https://github.com/fengweiqiang) em #1238 +- documentos: sincronize documentos por [@misitebao](https://github.com/misitebao) em #1260 + +## v2.0.0-beta.33 - 2022-03-05 + +### Adicionado + +- Suporte ao NSIS Installer para criar instaladores para aplicativos Windows - Obrigado [@stffabi](https://github.com/stffabi)🎉 +- Novo frontend: dev:watcher comando para girar observadores de terceiros quando estiver usando wails dev - Obrigado [@stffabi](https://github.com/stffabi)🎉 +- Modelos remotos agora suportam tags de versão - Obrigado [@misitebao](https://github.com/misitebao)🎉 + +### Corrigido + +- Uma série de correções para ARM Linux, proporcionando uma grande melhoria - Obrigado [@ianmjones](https://github.com/ianmjones)🎉 +- Fixa referência Nil potencial ao descobrir o caminho para `index.html` +- Corrigido falha ao usar métodos de `runtime.Log` em uma compilação de produção +- Melhorias na manipulação interna de arquivos significando que funcionários da web agora funcionarão no Windows - Obrigado [@stffabi](https://github.com/stffabi)🎉 + +### Alterado + +- O bootstrapper do Webview2 agora é executado como um usuário normal e não requer direitos de administrador +- A documentação foi melhorada e atualizada +- Guia de solução de problemas adicionado diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/coc.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/coc.mdx new file mode 100644 index 00000000..2ec7107c --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/coc.mdx @@ -0,0 +1,83 @@ +# Código de Conduta do Pacto de Contribuidor + +## Nosso Compromisso + +Nós, como membros, contribuidores e líderes se comprometem a fazer da participação na nossa comunidade uma experiência livre de assédio para todos, independentemente da idade, do corpo tamanho, da deficiência visível ou invisível, etnia, características sexuais, identidade e expressão de género, nível de experiência, educação, estatuto socioeconómico nacionalidade, aparência pessoal, raça, casta, cor, religião ou identidade e orientação sexual. + +Comprometemo-nos a agir e a interagir de formas que contribuam para uma comunidade aberta, bem-vinda, diversa, inclusiva e saudável. + +## Nossos Padrões + +Exemplos de comportamento que contribuem para um ambiente positivo para nossa comunidade incluem: + +- Demonstração de empatia e bondade para com outras pessoas +- Ser respeitoso com opiniões diferentes, pontos de vista e experiências +- Dando e aceitando graciosamente feedback construtivo +- Aceitar responsabilidade e pedir desculpas àqueles afetados por nossos erros, e aprender com a experiência +- Concentrar-se no que é melhor não apenas para nós como indivíduos, mas para toda a comunidade + +Exemplos de comportamento inaceitável incluem: + +- O uso de linguagem ou imagem sexualizada, e atenção sexual ou avanços de de qualquer tipo +- Trollar, insultar ou depreciar comentários e ataques políticos ou pessoais +- Assédio público ou privado +- Publicar informações privadas de terceiros, como um endereço físico ou de e-mail, sem sua permissão explícita +- Outra conduta que poderia razoavelmente ser considerada inapropriada em uma configuração profissional + +## Responsabilidades da Aplicação + +Os líderes da comunidade são responsáveis por esclarecer e aplicar nossos padrões de comportamento aceitável e tomarão uma ação corretiva apropriada e justa em resposta a qualquer comportamento que considerem inapropriado, ameaçando, ofensivo, ou prejudicial. + +Os líderes da comunidade têm o direito e a responsabilidade de remover, editar ou rejeitar comentários, commits, code, wiki edits, issues, e outras contribuições que não estão alinhadas a este Código de Conduta e comunicarão razões para decisões de moderação quando apropriado. + +## Contexto + +Este Código de Conduta aplica-se dentro de todos os espaços comunitários, e também se aplica quando um indivíduo está oficialmente representando a comunidade em espaços públicos. Exemplos de representar nossa comunidade incluem o uso de um endereço de e-mail oficial, postando através de uma conta de mídia social oficial, ou agindo como um representante nomeado em um evento online ou offline. + +## Execução + +Instâncias de comportamento abusivo, assédio ou de outra forma inaceitável podem ser relatadas aos líderes da comunidade responsáveis pela aplicação em coc@wails.io. Todas as queixas serão revistas e investigadas de forma rápida e justa. + +Todos os líderes da comunidade são obrigados a respeitar a privacidade e a segurança do repórter de qualquer incidente. + +## Diretrizes de execução + +Os líderes da comunidade seguirão essas diretrizes de impacto na determinação das consequências para qualquer ação que considerem violando este Código de Conduta: + +### 1. Correção + +**Impacto na Comunidade**: uso de linguagem inadequada ou outro comportamento considerado não profissional ou indesejado na comunidade. + +**Consequência**: uma advertência privada e escrita dos líderes da comunidade, fornecer clareza em torno da natureza da violação e uma explicação de por que o comportamento era inapropriado. Poderá solicitar-se um pedido de desculpas ao público. + +### 2. Aviso + +**Impacto Comunitário**: uma violação através de um único incidente ou uma série de ações. + +**Consequência**: um aviso com consequências para o comportamento contínuo. Nenhuma interação com as pessoas envolvidas, incluindo interação não solicitada com aqueles que aplicam o Código de Conduta, por um determinado período de tempo. Isto inclui evitar interações em espaços comunitários, bem como canais externos como mídia social. Violar esses termos pode levar a um banimento temporário ou permanente de. + +### 3. Banimento Temporário + +**Impacto da Comunidade**: Uma grave violação dos padrões da comunidade, incluindo comportamento inapropriado. + +**Consequência**: um banimento temporário de qualquer tipo de interação ou comunicação pública com a comunidade por um período específico de tempo. Não há nenhuma interação pública ou privada com as pessoas envolvidas, incluindo interação não solicitada com aqueles que aplicam o Código de Conduta, é permitido durante esse período. Violar estes termos pode levar a um banimento permanente. + +### 4. Banimento permanente + +**Impacto Comunitário**: Demonstrando um padrão de violação dos padrões da comunidade incluindo comportamento inadequado sustentado, assédio contra um indivíduo ou agressão contra ou disparo de classes de indivíduos. + +**Consequência**: um banimento permanente de qualquer tipo de interação pública dentro da comunidade. + +## Atribuição + +Este Código de Conduta foi adaptado do [Pacto do Contribuidor][homepage], versão 2.1, disponível em [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +As diretrizes de impacto da Comunidade foram inspiradas pelo [A escada do código de conduta da Mozilla][mozilla coc]. + +Para respostas a perguntas comuns sobre este código de conduta, veja a FAQ em [https://www.contributor-covenant.org/faq][faq]. As traduções estão disponíveis em [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/community-guide.mdx new file mode 100644 index 00000000..dc7753d9 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/community-guide.mdx @@ -0,0 +1,141 @@ +# Community Guide + +The number of Wails users is growing at an incredible rate, and if you're reading this, chances are you're ready to join. So... welcome! + +## Resources + +### Code of Conduct + +This [Code of Conduct](./coc) is an easy guide to develop the technical communities in which we participate. + +### Stay in the Know + +- Follow our [official Twitter account](https://twitter.com/wailsapp). + +### Get Support + +- [GitHub](https://github.com/wailsapp/wails) - If you have a bug to report or feature to request, that's what the GitHub issues are for. Please respect the rules specified in each repository's issue template. +- [Slack](https://gophers.slack.com/messages/CJ4P9F7MZ/) - A place for Wails devs to meet and chat in real time. +- [QQ Group(中文)](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - A Wails group for Chinese developers to communicate, where you can get help from other developers. + +### Explore the Ecosystem + +- [The Awesome Wails Page](https://github.com/wailsapp/awesome-wails) - See what other awesome resources have been published by other awesome people. + +## Ways of contributing + +Wails is an open source, community driven project. We welcome anyone to join us in contributing to the project. This documentation is aimed at anyone wishing to get familiar with the project and the development processes. + +There are many ways to contribute to the project: + +- Developing new features +- Fixing bugs +- Testing +- Documenting features +- Writing tutorials / guides +- Helping others on the issues + discussions boards + +Guides for these have been created in their own sections. Before getting started, please introduce yourself in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion. + +### Developing New Features + +We are always keen to add features to Wails and expand on what the project can do. The process for adding new features are as follows: + +- Pick an enhancement ticket with the "TODO" label. It's preferable to select one from the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) but the choice is yours. +- Before developing, check that the ticket includes the following information: + - The purpose of the enhancement + - What is out of scope for the enhancement + - What platforms the enhancement targets (most features should be cross-platform unless there's a very specific reason) +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. Sometimes placeholder tickets are created and require more details +- Comment on the ticket stating if you wish to develop the feature +- Clone the repository and create a branch with the format `feature/_` +- New features often require documentation so please ensure you have also added or updated the documentation as part of the changes +- Once the feature is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all enhancement requests are reviewed for good fit. Not all ideas will be selected, so it's best to have discussion about the enhancement first. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Fixing Bugs + +The process for fixing bugs are as follows: + +- Check the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) and select a bug to fix +- Before developing, check that the ticket includes the following information: +- The scope of the issue including platforms affected +- The steps to reproduce. Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) +- The output of `wails doctor` +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. +- Comment on the ticket stating you wish to develop a fix +- Clone the repository and create a branch with the format `bugfix/_` +- Once the fix is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all bugfixes should be discussed as the approach may have unintended side effects. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Testing + +Testing is vitally important to ensure quality in the project. There are a couple of scenarios where testing can really help the project: + +- Testing if a bug is reproducible on your local system +- Testing PRs to ensure that they work correctly + +If you chose to test if someone's bug report is reproducible on your local system, then feel free to add a comment on the ticket confirming this with the output of `wails doctor`. + +To test PRs, choose a PR to test and check if the PR description has the testing scenarios listed. If not, please ask the person who opened the PR to provide that list. Once you have determined a valid test scenario, please report your findings on the PR. + +If you ever need more clarity or help on testing, please ask a question in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion or on slack. + +### Documenting + +This website is also the main documentation site for the project. Sometimes this gets out of date and needs some slight adjustments. Some of the documentation isn't written to the best standards either. Developing documentation is hard and so any contribution to this is greatly appreciated. Features without documentation are unfinished so to the project, it's _as important_ as the code. + +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. + +To set up a local documentation development environment, do the following: + +- [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. + +#### Versioning + +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. + +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. + +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. + +#### Languages + +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. + +##### 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. + +### 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 slack channel. 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. + +To join the Wails slack channel, accept the invite [here](https://gophers.slack.com/join/shared_invite/zt-197vymgt3-sJt4oyakb6nqlVKjXTyeVw#/shared-invite/email) and join us on the channel by following [this link](https://gophers.slack.com/?redir=%2Fmessages%2FCJ4P9F7MZ%2F). + +:::note + +Work In Progress + +::: diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx new file mode 100644 index 00000000..2c70c7bb --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/credits.mdx @@ -0,0 +1,199 @@ +# Credits + +- [Lea Anthony](https://github.com/leaanthony) - Project owner, lead developer +- [Stffabi](https://github.com/stffabi) - Technical lead, developer and maintainer +- [Misite Bao](https://github.com/misitebao) - Documentation wizard, Chinese translation, Windows testing, Bug finder general +- [Travis McLane](https://github.com/tmclane) - Cross-compilation work, MacOS testing +- [Byron Chris](https://github.com/bh90210) - Linux distro wizard, Linux testing + +## Sponsors + + +## Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Lea Anthony

💻 🤔 🎨 🖋 💡 🧑‍🏫 📆 🔧 🐛 📝 🚧 📦 👀 💬 🔬 ⚠️ 📢 👀 📖

stffabi

💻 🤔 🎨 🐛 🚧 📦 👀 💬 🔬 👀 📖 ⚠️

Travis McLane

💻 🔬 📦 🤔 🐛 👀 ⚠️ 💬 📖

Misite Bao

📖 🌍 🔬 🚧

Byron Chris

💻 🔬 🚧 🐛 👀 ⚠️ 💬 🤔 🎨 📦 🚇

konez2k

💻 📦 🤔

Dario Emerson

💻 🐛 🤔 ⚠️

Ian M. Jones

💻 🐛 🤔 ⚠️ 👀 📦

marktohark

💻

Ryan H

💻

Cody Bentley

💻 📦 🤔 💵

Florent

💻 🐛

Alexander Hudek

💻 💵

Tim Kipp

💻

Altynbek Kaliakbarov

💻

Nikolai Zimmermann

💻

k-muchmore

💻

Snider

💻 🤔 📖 💵

Albert Sun

💻 ⚠️

Ariel

💻 🐛

Ilgıt Yıldırım

💻 🐛 💵

Toyam Cox

💻 📦 🐛

hi019

💻 🐛

Arthur Wiebe

💻 🐛

Balakrishna Prasad Ganne

💻

BillBuilt

💻 📦 🤔 💬 💵

Eng Zer Jun

🚧 💻

LGiki

📖

Lontten

📖

Lukas Crepaz

💻 🐛

Marcus Crane

🐛 📖 💵

Qais Patankar

📖

Wakeful-Cloud

💻 🐛

Zámbó, Levente

💻 📦 🐛 ⚠️

Ironpark

💻 🤔

mondy

💻 📖

Benjamin Ryan

🐛

fallendusk

📦 💻

Mat Ryer

💻 🤔 🐛

Abtin

💻 🐛

Adrian Lanzafame

📦 💻

Aleksey Polyakov

🐛 💻

Alexander Matviychuk

💻 📦

AlienRecall

💻 📦

Aman

📖

Amaury Tobias Quiroz

💻 🐛

Andreas Wenk

📖

Antonio Stanković

💻 📦

Arpit Jain

📖

Austin Schey

💻 🐛

Benjamin Thomas

💻 📦 🤔

Bertram Truong

💻 🐛

Blake Bourque

📖

Denis

📖

diogox

💻 📦

Dmitry Gomzyakov

💻 📦

Edward Browncross

💻

Elie Grenon

💻

Florian Didron

💻 🐛 🤔 ⚠️ 👀 📦

GargantuaX

💵

Igor Minin

💻 🐛

Jae-Sung Lee

💻 🤔

Jarek

💻 📦

Junker

📖

Kris Raney

💻 🐛

Luken

📖

Mark Stenglein

💻 🐛

buddyabaddon

💻

MikeSchaap

💻 🐛

NYSSEN Michaël

💻 🐛

Nan0

💻 🤔 ⚠️ 👀

oskar

📖

Pierre Joye

💻 🐛 🤔 ⚠️

Reuben Thomas-Davis

💻 🐛

Robin

💻 🐛

Sebastian Bauer

💻 🤔 ⚠️ 👀 💬

Sidharth Rathi

📖 🐛

Sithembiso Khumalo

💻 🐛

Soheib El-Harrache

💻 🐛 💵

Sophie Au

💻 🐛

Stefanos Papadakis

💻 🐛

Steve Chung

💻 🐛

Timm Ortloff

📖

Tom

💻

Valentin Trinqué

💻 🐛

mattn

💻 🐛

bearsh

💻 🤔 📖

chenxiao

💻 🤔 📖

fengweiqiang

💻 📦

flin7

📖

fred21O4

📖

gardc

📖

rayshoo

📖

Ishiyama Yuzuki

💻 🐛

佰阅

💻

刀刀

📖 🐛

归位

💻 🐛

skamensky

💻 🤔 📖

dependabot[bot]

💻 🚧

Damian Sieradzki

💵

John Dorman

💵

Ian Sinnott

💵

Arden Shackelford

💵

Bironou

💵

CharlieGo_

💵

overnet

💵

jugglingjsons

💵

Selvin Ortiz

💵

ZanderCodes

💵

Michael Voronov

💵

letheanVPN

💵

Tai Groot

💵

easy-web-it

💵

Michael Olson

💵

EdenNetwork Italia

💵

ondoki

💵

QuEST Rail LLC

💵

Gilgameš

💵

Bernt-Johan Bergshaven

💵

Liam Bigelow

💵

Nick Arellano

💵

Frank Chiarulli Jr.

💵

Tyler

💵

Trea Hauet

💵

Kent 'picat' Gruber

💵

tc-hib

💵

Antonio

📖

MyNameIsAres

📖

Maicarons J

📖

kiddov

📖 💵 ⚠️ 🤔

Nicolas Coutin

💵

Parvin Eyvazov

📖
+ + + + + + +## Special Mentions + +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version possible. +- [Tad Vizbaras](https://github.com/tadvi) - His winc project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - For advice, support and bants. +- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been invaluable. +- [Justen Walker](https://github.com/justenwalker/) - For helping wrangle COM issues which got v2 over the line. +- [Wang, Chi](https://github.com/patr0nus/) - The DeskGap project was a huge influence on the direction of Wails v2. +- [Serge Zaitsev](https://github.com/zserge) - Whilst Wails does not use the Webview project, it is still a source of inspiration. diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/faq.mdx b/website/i18n/pt/docusaurus-plugin-content-pages/faq.mdx new file mode 100644 index 00000000..98b68d55 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/faq.mdx @@ -0,0 +1,9 @@ +# FAQ + +## What's with the name? + +When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (**W**ebview on R**ails**). It just so happened to also be a homophone of the English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck. + +## Is this an alternative to Electron? + +Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Wails v2 does offer native elements such as menus and dialogs, so it is becoming a lightweight electron alternative. diff --git a/website/i18n/pt/docusaurus-plugin-content-pages/markdown-page.md b/website/i18n/pt/docusaurus-plugin-content-pages/markdown-page.md new file mode 100644 index 00000000..9756c5b6 --- /dev/null +++ b/website/i18n/pt/docusaurus-plugin-content-pages/markdown-page.md @@ -0,0 +1,7 @@ +--- +title: Markdown page example +--- + +# Markdown page example + +You don't need React to write simple standalone pages. diff --git a/website/i18n/pt/docusaurus-theme-classic/footer.json b/website/i18n/pt/docusaurus-theme-classic/footer.json new file mode 100644 index 00000000..4d6eb27d --- /dev/null +++ b/website/i18n/pt/docusaurus-theme-classic/footer.json @@ -0,0 +1,54 @@ +{ + "link.title.Docs": { + "message": "Documentação", + "description": "The title of the footer links column with title=Docs in the footer" + }, + "link.title.Community": { + "message": "Comunidade", + "description": "The title of the footer links column with title=Community in the footer" + }, + "link.title.More": { + "message": "Mais", + "description": "The title of the footer links column with title=More in the footer" + }, + "link.item.label.Introduction": { + "message": "Introdução", + "description": "The label of footer link with label=Introduction linking to /docs/introduction" + }, + "link.item.label.Getting Started": { + "message": "Guia de Introdução", + "description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation" + }, + "link.item.label.Changelog": { + "message": "Registo de alterações", + "description": "The label of footer link with label=Changelog linking to /changelog" + }, + "link.item.label.Github": { + "message": "GitHub", + "description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails" + }, + "link.item.label.Twitter": { + "message": "Twitter", + "description": "The label of footer link with label=Twitter linking to https://twitter.com/wailsapp" + }, + "link.item.label.Slack": { + "message": "Slack", + "description": "The label of footer link with label=Slack linking to https://gophers.slack.com/messages/CJ4P9F7MZ/" + }, + "link.item.label.Slack invite": { + "message": "Convite Slack", + "description": "The label of footer link with label=Slack invite linking to https://invite.slack.golangbridge.org/" + }, + "link.item.label.Blog": { + "message": "Blog", + "description": "The label of footer link with label=Blog linking to /blog" + }, + "copyright": { + "message": "Copyright © 2022 Lea Anthony", + "description": "The footer copyright" + }, + "link.item.label.Awesome": { + "message": "Fantástico", + "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" + } +} diff --git a/website/i18n/pt/docusaurus-theme-classic/navbar.json b/website/i18n/pt/docusaurus-theme-classic/navbar.json new file mode 100644 index 00000000..ad228a5f --- /dev/null +++ b/website/i18n/pt/docusaurus-theme-classic/navbar.json @@ -0,0 +1,42 @@ +{ + "item.label.Sponsor": { + "message": "Patrocinador ❤", + "description": "Navbar item with label Sponsor" + }, + "item.label.Docs": { + "message": "Documentação", + "description": "Navbar item with label Docs" + }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, + "item.label.GitHub": { + "message": "GitHub", + "description": "Navbar item with label GitHub" + }, + "item.label.About": { + "message": "Sobre", + "description": "Navbar item with label About" + }, + "item.label.FAQ": { + "message": "Perguntas Frequentes", + "description": "Navbar item with label FAQ" + }, + "item.label.Changelog": { + "message": "Registo de alterações", + "description": "Navbar item with label Changelog" + }, + "item.label.Community Guide": { + "message": "Guia da Comunidade", + "description": "Navbar item with label Community Guide" + }, + "item.label.Credits": { + "message": "Créditos", + "description": "Navbar item with label Credits" + }, + "item.label.Code of Conduct": { + "message": "Código de Conduta", + "description": "Navbar item with label Code of Conduct" + } +} diff --git a/website/i18n/ru/code.json b/website/i18n/ru/code.json index 7873285c..052cf899 100644 --- a/website/i18n/ru/code.json +++ b/website/i18n/ru/code.json @@ -1,37 +1,37 @@ { "homepage.Features.Title1": { - "message": "homepage.Features.Title1" + "message": "Многофункциональность" }, "homepage.Features.Description1": { - "message": "homepage.Features.Description1" + "message": "Создавайте полные кроссплатформенные приложения, используя системные элементы интерфейса, такие как меню и диалоги." }, "homepage.Features.Title2": { - "message": "homepage.Features.Title2" + "message": "Знакомый" }, "homepage.Features.Description2": { - "message": "homepage.Features.Description2" + "message": "Используйте уже известные технологии для создания удивительных приложений." }, "homepage.Features.Title3": { - "message": "homepage.Features.Title3" + "message": "Быстрый" }, "homepage.Features.Description3": { - "message": "homepage.Features.Description3" + "message": "Сгенерируйте и создавайте проекты с помощью Wails CLI." }, "homepage.Tagline": { - "message": "homepage.Tagline" - }, - "homepage.LearnMoreButtonText": { - "message": "homepage.LearnMoreButtonText" + "message": "Создавайте красивые кроссплатформенные приложения с помощью Go" }, "homepage.ButtonText": { - "message": "homepage.ButtonText" + "message": "Начало работы" + }, + "homepage.LearnMoreButtonText": { + "message": "Подробнее" }, "theme.ErrorPageContent.title": { "message": "На странице произошёл сбой.", "description": "The title of the fallback page when the page crashed" }, "theme.ErrorPageContent.tryAgain": { - "message": "Попробуйте ещё раз", + "message": "Попробуйте еще раз", "description": "The label of the button to try again when the page crashed" }, "theme.NotFound.title": { @@ -43,9 +43,263 @@ "description": "The first paragraph of the 404 page" }, "theme.NotFound.p2": { - "message": "Пожалуйста, обратитесь к владельцу сайта, с которого вы перешли на эту ссылку, чтобы сообщить ему, что ссылка не работает.", + "message": "Пожалуйста, обратитесь к владельцу сайта, с которого вы перешли на эту ссылку, чтобы сообщить ему ссылка не работает.", "description": "The 2nd paragraph of the 404 page" }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Закрыть", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.archive.title": { + "message": "Архив", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "Архив", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "Прокрутить вверх", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "Навигация по страницам блога", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "Следующие записи", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "Предыдущие записи", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.readingTime.plurals": { + "message": "Минута чтения | {readingTime} мин. чтения", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.post.readMoreLabel": { + "message": "Подробнее о «{title}»", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readMore": { + "message": "Подробнее", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "Навигация по страницам блога", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "Следующий пост", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "Предыдущий пост", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Навигация по последним постам в блоге", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.blog.post.plurals": { + "message": "Один пост|{count} постов", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} с меткой \"{tagName}\"", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "Показать все теги", + "description": "The label of the link targeting the tag list page" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "Скопировать в буфер обмена", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copied": { + "message": "Скопировано", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copy": { + "message": "Копировать", + "description": "The copy button label on code blocks" + }, + "theme.colorToggle.ariaLabel": { + "message": "Переключайтесь между темной и светлой темой (сейчас {mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "темная тема", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "светлая тема", + "description": "The name for the light color mode" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count} элементов", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "Развернуть боковую панель", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "Развернуть боковую панель", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "Навигация по документации", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "Предыдущие", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "Следующие", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "Свернуть боковую панель", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "Свернуть боковую панель", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "Переключить сворачиваемою боковую панель категории '{label}'", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "Один документ с тегами|{count} документов с тегами", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged} с тэгом «{tagName}»", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "Версия: {versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "Это документация {siteTitle} для версии {versionLabel}, которая уже не поддерживается.", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "latest version", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "Edit this page", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "Direct link to heading", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": " on {date}", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": " by {user}", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "Last updated{atDate}{byUser}", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "Versions", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.common.skipToMainContent": { + "message": "Skip to main content", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsListLabel": { + "message": "Tags:", + "description": "The label alongside a tag list" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "Languages", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.SearchBar.seeAll": { + "message": "See all {count} results" + }, + "theme.SearchBar.label": { + "message": "Search", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "One document found|{count} documents found", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "Search results for \"{query}\"", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "Search the documentation", + "description": "The search page title for empty query" + }, + "theme.SearchPage.inputPlaceholder": { + "message": "Type your search here", + "description": "The placeholder for search page input" + }, + "theme.SearchPage.inputLabel": { + "message": "Search", + "description": "The ARIA label for search page input" + }, + "theme.SearchPage.algoliaLabel": { + "message": "Search by Algolia", + "description": "The ARIA label for Algolia mention" + }, + "theme.SearchPage.noResultsText": { + "message": "No results were found", + "description": "The paragraph for empty search result" + }, + "theme.SearchPage.fetchingNewResults": { + "message": "Fetching new results...", + "description": "The paragraph for fetching new search results" + }, + "theme.tags.tagsPageTitle": { + "message": "Tags", + "description": "The title of the tag list page" + }, + "theme.docs.breadcrumbs.home": { + "message": "Home page", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "Breadcrumbs", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "Toggle word wrap", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, "theme.admonition.note": { "message": "note", "description": "The default label used for the Note admonition (:::note)" @@ -66,256 +320,6 @@ "message": "caution", "description": "The default label used for the Caution admonition (:::caution)" }, - "theme.BackToTopButton.buttonAriaLabel": { - "message": "Прокрутка к началу", - "description": "The ARIA label for the back to top button" - }, - "theme.blog.archive.title": { - "message": "Архив", - "description": "The page & hero title of the blog archive page" - }, - "theme.blog.archive.description": { - "message": "Архив", - "description": "The page & hero description of the blog archive page" - }, - "theme.blog.paginator.navAriaLabel": { - "message": "Навигация по странице списка блогов", - "description": "The ARIA label for the blog pagination" - }, - "theme.blog.paginator.newerEntries": { - "message": "Следующие записи", - "description": "The label used to navigate to the newer blog posts page (previous page)" - }, - "theme.blog.paginator.olderEntries": { - "message": "Предыдущие записи", - "description": "The label used to navigate to the older blog posts page (next page)" - }, - "theme.blog.post.paginator.navAriaLabel": { - "message": "Навигация по странице поста блога", - "description": "The ARIA label for the blog posts pagination" - }, - "theme.blog.post.paginator.newerPost": { - "message": "Следующий пост", - "description": "The blog post button label to navigate to the newer/previous post" - }, - "theme.blog.post.paginator.olderPost": { - "message": "Предыдущий пост", - "description": "The blog post button label to navigate to the older/next post" - }, - "theme.docs.breadcrumbs.home": { - "message": "Главная страница", - "description": "The ARIA label for the home page in the breadcrumbs" - }, - "theme.docs.breadcrumbs.navAriaLabel": { - "message": "Навигационная цепочка текущей страницы", - "description": "The ARIA label for the breadcrumbs" - }, - "theme.docs.DocCard.categoryDescription": { - "message": "{count} элемент|{count} элемента|{count} элементов", - "description": "The default description for a category card in the generated index about how many items this category includes" - }, - "theme.colorToggle.ariaLabel": { - "message": "Переключение между темным и светлым режимом (сейчас используется {mode})", - "description": "The ARIA label for the navbar color mode toggle" - }, - "theme.colorToggle.ariaLabel.mode.dark": { - "message": "Тёмный режим", - "description": "The name for the dark color mode" - }, - "theme.colorToggle.ariaLabel.mode.light": { - "message": "Светлый режим", - "description": "The name for the light color mode" - }, - "theme.blog.post.plurals": { - "message": "{count} запись|{count} записи|{count} записей", - "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.blog.tagTitle": { - "message": "{nPosts} с тегом \"{tagName}\"", - "description": "The title of the page for a blog tag" - }, - "theme.tags.tagsPageLink": { - "message": "Посмотреть все теги", - "description": "The label of the link targeting the tag list page" - }, - "theme.docs.paginator.navAriaLabel": { - "message": "Навигация по странице документации", - "description": "The ARIA label for the docs pagination" - }, - "theme.docs.paginator.previous": { - "message": "Предыдущая страница", - "description": "The label used to navigate to the previous doc" - }, - "theme.docs.paginator.next": { - "message": "Следующая страница", - "description": "The label used to navigate to the next doc" - }, - "theme.docs.tagDocListPageTitle.nDocsTagged": { - "message": "Одна страница|{count} страницы|{count} страниц", - "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.tagDocListPageTitle": { - "message": "{nDocsTagged} с тегом \"{tagName}\"", - "description": "The title of the page for a docs tag" - }, - "theme.docs.versionBadge.label": { - "message": "Версия: {versionLabel}" - }, - "theme.docs.versions.unreleasedVersionLabel": { - "message": "Это документация для будущей версии {siteTitle} {versionLabel}.", - "description": "The label used to tell the user that he's browsing an unreleased doc version" - }, - "theme.docs.versions.unmaintainedVersionLabel": { - "message": "Это документация {siteTitle} для версии {versionLabel}, которая уже не поддерживается.", - "description": "The label used to tell the user that he's browsing an unmaintained doc version" - }, - "theme.docs.versions.latestVersionSuggestionLabel": { - "message": "Актуальная документация находится на странице {latestVersionLink} ({versionLabel}).", - "description": "The label used to tell the user to check the latest version" - }, - "theme.docs.versions.latestVersionLinkLabel": { - "message": "последней версии", - "description": "The label used for the latest version suggestion link label" - }, - "theme.common.editThisPage": { - "message": "Отредактировать эту страницу", - "description": "The link label to edit the current page" - }, - "theme.common.headingLinkTitle": { - "message": "Прямая ссылка на этот заголовок", - "description": "Title for link to heading" - }, - "theme.lastUpdated.atDate": { - "message": " {date}", - "description": "The words used to describe on which date a page has been last updated" - }, - "theme.lastUpdated.byUser": { - "message": " от {user}", - "description": "The words used to describe by who the page has been last updated" - }, - "theme.lastUpdated.lastUpdatedAtBy": { - "message": "Последнее обновление{atDate}{byUser}", - "description": "The sentence used to display when a page has been last updated, and by who" - }, - "theme.navbar.mobileVersionsDropdown.label": { - "message": "Версии", - "description": "The label for the navbar versions dropdown on mobile view" - }, - "theme.common.skipToMainContent": { - "message": "Перейти к основному содержимому", - "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" - }, - "theme.tags.tagsListLabel": { - "message": "Теги:", - "description": "The label alongside a tag list" - }, - "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Закрыть", - "description": "The ARIA label for close button of announcement bar" - }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Навигация по последним постам в блоге", - "description": "The ARIA label for recent posts in the blog sidebar" - }, - "theme.CodeBlock.copied": { - "message": "Скопировано", - "description": "The copied button label on code blocks" - }, - "theme.CodeBlock.copyButtonAriaLabel": { - "message": "Скопировать в буфер обмена", - "description": "The ARIA label for copy code blocks button" - }, - "theme.CodeBlock.copy": { - "message": "Скопировать", - "description": "The copy button label on code blocks" - }, - "theme.CodeBlock.wordWrapToggle": { - "message": "Toggle word wrap", - "description": "The title attribute for toggle word wrapping button of code block lines" - }, - "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { - "message": "Свернуть/развернуть категорию '{label}'", - "description": "The ARIA label to toggle the collapsible sidebar category" - }, - "theme.navbar.mobileLanguageDropdown.label": { - "message": "Языки", - "description": "The label for the mobile language switcher dropdown" - }, - "theme.TOCCollapsible.toggleButtonLabel": { - "message": "Содержание этой страницы", - "description": "The label used by the button on the collapsible TOC component" - }, - "theme.blog.post.readMore": { - "message": "Читать дальше", - "description": "The label used in blog post item excerpts to link to full blog posts" - }, - "theme.blog.post.readMoreLabel": { - "message": "Подробнее о {title}", - "description": "The ARIA label for the link to full blog posts from excerpts" - }, - "theme.blog.post.readingTime.plurals": { - "message": "{readingTime} мин. чтения", - "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.docs.sidebar.collapseButtonTitle": { - "message": "Свернуть сайдбар", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.docs.sidebar.collapseButtonAriaLabel": { - "message": "Свернуть сайдбар", - "description": "The title attribute for collapse button of doc sidebar" - }, - "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { - "message": "← Перейти к главному меню", - "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" - }, - "theme.docs.sidebar.expandButtonTitle": { - "message": "Развернуть сайдбар", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.docs.sidebar.expandButtonAriaLabel": { - "message": "Развернуть сайдбар", - "description": "The ARIA label and title attribute for expand button of doc sidebar" - }, - "theme.SearchPage.documentsFound.plurals": { - "message": "{count} документ|{count} документа|{count} документов", - "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.SearchPage.existingResultsTitle": { - "message": "Результаты поиска по запросу \"{query}\"", - "description": "The search page title for non-empty query" - }, - "theme.SearchPage.emptyResultsTitle": { - "message": "Поиск по сайту", - "description": "The search page title for empty query" - }, - "theme.SearchPage.inputPlaceholder": { - "message": "Введите фразу для поиска", - "description": "The placeholder for search page input" - }, - "theme.SearchPage.inputLabel": { - "message": "Поиск", - "description": "The ARIA label for search page input" - }, - "theme.SearchPage.algoliaLabel": { - "message": "Поиск от Algolia", - "description": "The ARIA label for Algolia mention" - }, - "theme.SearchPage.noResultsText": { - "message": "По запросу ничего не найдено", - "description": "The paragraph for empty search result" - }, - "theme.SearchPage.fetchingNewResults": { - "message": "Загрузка новых результатов поиска...", - "description": "The paragraph for fetching new search results" - }, - "theme.SearchBar.seeAll": { - "message": "Посмотреть все результаты ({count})" - }, - "theme.SearchBar.label": { - "message": "Поиск", - "description": "The ARIA label and placeholder for search button" - }, "theme.SearchModal.searchBox.resetButtonTitle": { "message": "Clear the query", "description": "The label and ARIA label for search box reset button" @@ -407,9 +411,5 @@ "theme.SearchModal.placeholder": { "message": "Search docs", "description": "The placeholder of the input of the DocSearch pop-up modal" - }, - "theme.tags.tagsPageTitle": { - "message": "Теги", - "description": "The title of the tag list page" } } diff --git a/website/i18n/ru/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx b/website/i18n/ru/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx new file mode 100644 index 00000000..8cbbff9f --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-blog/2021-09-27-v2-beta1-release-notes.mdx @@ -0,0 +1,161 @@ +--- +slug: wails-v2-beta-for-windows +title: Wails v2 Beta for Windows +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Когда я впервые анонсировал Wails на Реддите, чуть более 2 лет назад из поезда в Сидней, Я не ожидал, что он получит значительное внимание. Несколько дней спустя, успешный технологический влоггер выпустил видео учебник, дал положительный отзыв, и с этого момента интерес к проекту резко возрос. + +Совершенно очевидно, что люди с удовольствием добавляли веб-интерфейсы в их Go проекты. и почти немедленно вытеснял проект за рамки концепции, которую я создал. В то время Wails использовал проект [webview](https://github.com/webview/webview) для работы с фронтендом, а единственным вариантом для Windows был рендер IE11. Многие сообщения об ошибках были из-за его ограничений: плохая поддержка JavaScript/CSS и отсутствие утилит разработчика для отладки. Это был разочарованный опыт разработки, но не так много было бы сделано для его исправления. + +В течение долгого времени я бы твердо верил, что Microsoft в конечном итоге придется разобраться с ситуацией в браузере. Мир жил дальше, бум развития фронтенд технологий и IE не пережил его. Когда компания Microsoft объявила о переходе к использованию Chromium в качестве основы для развития их нового браузера, я знал, что это было всего лишь вопрос времени, пока Wails смогут использовать его, и перенести опыт разработчика Windows на следующий уровень. + +Сегодня я рад сообщить: **Wails v2 Beta для Windows**! В этом выпуске есть огромное количество изменений, так что возьмите напиток, устройтесь поудобнее, и мы начнем... + +### Нет зависимости от CGO! + +Нет, я не шутил: _Нет_ _CGO_ _зависимости_🤯! The thing about Windows is that, unlike MacOS and Linux, it doesn't come with a default compiler. In addition, CGO requires a mingw compiler and there's a ton of different installation options. Removing the CGO requirement has massively simplified setup, as well as making debugging an awful lot easier. Whilst I have put a fair bit of effort in getting this working, the majority of the credit should go to [John Chadwick](https://github.com/jchv) for not only starting a couple of projects to make this possible, but also being open to someone taking those projects and building on them. Credit also to [Tad Vizbaras](https://github.com/tadvi) whose [winc](https://github.com/tadvi/winc) project started me down this path. + +### WebView2 Chromium Renderer + +```mdx-code-block +
+ +
+
+``` + +Finally, Windows developers get a first class rendering engine for their applications! Gone are the days of contorting your frontend code to work on Windows. On top of that, you get a first-class developer tools experience! + +The WebView2 component does, however, have a requirement to have the `WebView2Loader.dll` sitting alongside the binary. This makes distribution just that little bit more painful than we gophers are used to. All solutions and libraries (that I know of) that use WebView2 have this dependency. + +However, I'm really excited to announce that Wails applications _have no such requirement_! Thanks to the wizardry of [John Chadwick](https://github.com/jchv), we are able to bundle this dll inside the binary and get Windows to load it as if it were present on disk. + +Gophers rejoice! The single binary dream lives on! + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +There is now the option to generate IDE configuration along with your project. This means that if you open your project in a supported IDE, it will already be configured for building and debugging your application. Currently VSCode is supported but we hope to support other IDEs such as Goland soon. + +```mdx-code-block +
+ +
+
+``` + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +```mdx-code-block +
+ +
+
+``` + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### In Conclusion + +Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome. Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +There were many twists and turns, pivots and u-turns to get to this point. This was due partly to early technical decisions that needed changing, and partly because some core problems we had spent time building workarounds for were fixed upstream: Go’s embed feature is a good example. Fortunately, everything came together at the right time, and today we have the very best solution that we can have. I believe the wait has been worth it - this would not have been possible even 2 months ago. + +I also need to give a huge thank you :pray: to the following people because without them, this release just wouldn't exist: + +- [Misite Bao](https://github.com/misitebao) - An absolute workhorse on the Chinese translations and an incredible bug finder. +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version we have today possible. +- [Tad Vizbaras](https://github.com/tadvi) - Experimenting with his [winc](https://github.com/tadvi/winc) project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - His support, encouragement and feedback has really helped drive the project forward. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: MacOS and Linux users need not feel left out - porting to this new foundation is actively under way and most of the hard work has already been done. Hang in there! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ru/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx b/website/i18n/ru/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx new file mode 100644 index 00000000..76ae8c80 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-blog/2021-11-08-v2-beta2-release-notes.mdx @@ -0,0 +1,170 @@ +--- +slug: wails-v2-beta-for-mac +title: Wails v2 Beta for MacOS +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +Today marks the first beta release of Wails v2 for Mac! It's taken quite a while to get to this point and I'm hoping that today's release will give you something that's reasonably useful. There have been a number of twists and turns to get to this point and I'm hoping, with your help, to iron out the crinkles and get the Mac port polished for the final v2 release. + +You mean this isn't ready for production? For your use case, it may well be ready, but there are still a number of known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would like to contribute, you'd be very welcome! + +So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### Mac Specific Options + +In addition to the normal application options, Wails v2 for Mac also brings some Mac extras: + +- Make your window all funky and translucent, like all the pretty swift apps! +- Highly customisable titlebar +- We support the NSAppearance options for the application +- Simple config to auto-create an "About" menu + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Native M1 Support + +Thanks to the amazing support of [Mat Ryer](https://github.com/matryer/), the Wails project now supports M1 native builds: + +```mdx-code-block +
+ +
+
+``` + +You can also specify `darwin/amd64` as a target too: + +```mdx-code-block +
+ +
+
+``` + +Oh, I almost forgot.... you can also do `darwin/universal`.... :wink: + +```mdx-code-block +
+ +
+
+``` + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### WKWebView Renderer + +V1 relied on a (now deprecated) WebView component. V2 uses the most recent WKWebKit component so expect the latest and greatest from Apple. + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +And finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors), including [JetBrains](https://www.jetbrains.com?from=Wails), whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: Linux users, you're next! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ru/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx b/website/i18n/ru/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx new file mode 100644 index 00000000..eb7f2a46 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-blog/2022-02-22-v2-beta3-release-notes.mdx @@ -0,0 +1,114 @@ +--- +slug: wails-v2-beta-for-linux +title: Wails v2 Beta for Linux +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +I'm pleased to finally announce that Wails v2 is now in beta for Linux! It is somewhat ironic that the very first experiments with v2 was on Linux and yet it has ended up as the last release. That being said, the v2 we have today is very different from those first experiments. So without further ado, let's go over the new features: + +### New Features + +```mdx-code-block +
+ +
+
+``` + +There were a lot of requests for native menu support. Wails has finally got you covered. Application menus are now available and include support for most native menu features. This includes standard menu items, checkboxes, radio groups, submenus and separators. + +There were a huge number of requests in v1 for the ability to have greater control of the window itself. I'm happy to announce that there's new runtime APIs specifically for this. It's feature-rich and supports multi-monitor configurations. There is also an improved dialogs API: Now, you can have modern, native dialogs with rich configuration to cater for all your dialog needs. + +### No requirement to bundle assets + +A huge pain-point of v1 was the need to condense your entire application down to single JS & CSS files. I'm happy to announce that for v2, there is no requirement to bundle assets, in any way, shape or form. Want to load a local image? Use an `` tag with a local src path. Want to use a cool font? Copy it in and add the path to it in your CSS. + +> Wow, that sounds like a webserver... + +Yes, it works just like a webserver, except it isn't. + +> So how do I include my assets? + +You just pass a single `embed.FS` that contains all your assets into your application configuration. They don't even need to be in the top directory - Wails will just work it out for you. + +### New Development Experience + +Now that assets don't need to be bundled, it's enabled a whole new development experience. The new `wails dev` command will build and run your application, but instead of using the assets in the `embed.FS`, it loads them directly from disk. + +It also provides the additional features: + +- Hot reload - Any changes to frontend assets will trigger and auto reload of the application frontend +- Auto rebuild - Any changes to your Go code will rebuild and relaunch your application + +In addition to this, a webserver will start on port 34115. This will serve your application to any browser that connects to it. All connected web browsers will respond to system events like hot reload on asset change. + +In Go, we are used to dealing with structs in our applications. It's often useful to send structs to our frontend and use them as state in our application. In v1, this was a very manual process and a bit of a burden on the developer. I'm happy to announce that in v2, any application run in dev mode will automatically generate Typescript models for all structs that are input or output parameters to bound methods. This enables seamless interchange of data models between the two worlds. + +In addition to this, another JS module is dynamically generated wrapping all your bound methods. This provides JSDoc for your methods, providing code completion and hinting in your IDE. It's really cool when you get data models auto-imported when hitting tab in an auto-generated module wrapping your Go code! + +### Remote Templates + +```mdx-code-block +
+ +
+
+``` + +Getting an application up and running quickly was always a key goal for the Wails project. When we launched, we tried to cover a lot of the modern frameworks at the time: react, vue and angular. The world of frontend development is very opinionated, fast moving and hard to keep on top of! As a result, we found our base templates getting out of date pretty quickly and this caused a maintenance headache. It also meant that we didn't have cool modern templates for the latest and greatest tech stacks. + +With v2, I wanted to empower the community by giving you the ability to create and host templates yourselves, rather than rely on the Wails project. So now you can create projects using community supported templates! I hope this will inspire developers to create a vibrant ecosystem of project templates. I'm really quite excited about what our developer community can create! + +### Cross Compilation to Windows + +Because Wails v2 for Windows is pure Go, you can target Windows builds without docker. + +```mdx-code-block +
+ +
+
+``` + +### In Conclusion + +As I'd said in the Windows release notes, Wails v2 represents a new foundation for the project. The aim of this release is to get feedback on the new approach, and to iron out any bugs before a full release. Your input would be most welcome! Please direct any feedback to the [v2 Beta](https://github.com/wailsapp/wails/discussions/828) discussion board. + +Linux is **hard** to support. We expect there to be a number of quirks with the beta. Please help us to help you by filing detailed bug reports! + +Finally, I'd like to give a special thank you to all the [project sponsors](/credits#sponsors) whose support drive the project in many ways behind the scenes. + +I look forward to seeing what people build with Wails in this next exciting phase of the project! + +Lea. + +PS: The v2 release isn't far off now! + +PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ru/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx b/website/i18n/ru/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx new file mode 100644 index 00000000..e9d570af --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-blog/2022-09-22-v2-release-notes.mdx @@ -0,0 +1,98 @@ +--- +slug: wails-v2-released +title: Wails v2 Released +authors: + - leaanthony +tags: + - wails + - v2 +--- + +```mdx-code-block +
+ +
+
+``` + +# It's here! + +Today marks the release of [Wails](https://wails.io) v2. It's been about 18 months since the first v2 alpha and about a year from the first beta release. I'm truly grateful to everyone involved in the evolution of the project. + +Part of the reason it took that long was due to wanting to get to some definition of completeness before officially calling it v2. The truth is, there's never a perfect time to tag a release - there's always outstanding issues or "just one more" feature to squeeze in. What tagging an imperfect major release does do, however, is to provide a bit of stability for users of the project, as well as a bit of a reset for the developers. + +This release is more than I'd ever expected it to be. I hope it gives you as much pleasure as it has given us to develop it. + +# What _is_ Wails? + +If you are unfamiliar with Wails, it is a project that enables Go programmers to provide rich frontends for their Go programs using familiar web technologies. It's a lightweight, Go alternative to Electron. Much more information can be found on the [official site](https://wails.io/docs/introduction). + +# What's new? + +The v2 release is a huge leap forward for the project, addressing many of the pain points of v1. If you have not read any of the blog posts on the Beta releases for [macOS](/blog/wails-v2-beta-for-mac), [Windows](/blog/wails-v2-beta-for-windows) or [Linux](/blog/wails-v2-beta-for-linux), then I encourage you to do so as it covers all the major changes in more detail. In summary: + +- Webview2 component for Windows that supports modern web standards and debugging capabilities. +- [Dark / Light theme](/docs/reference/options#theme) + [custom theming](/docs/reference/options#customtheme) on Windows. +- Windows now has no CGO requirements. +- Out-of-the-box support for Svelte, Vue, React, Preact, Lit & Vanilla project templates. +- [Vite](https://vitejs.dev/) integration providing a hot-reload development environment for your application. +- Native application [menus](/docs/guides/application-development#application-menu) and [dialogs](/docs/reference/runtime/dialog). +- Native window translucency effects for [Windows](/docs/reference/options#windowistranslucent) and [macOS](/docs/reference/options#windowistranslucent-1). Support for Mica & Acrylic backdrops. +- Easily generate an [NSIS installer](/docs/guides/windows-installer) for Windows deployments. +- A rich [runtime library](/docs/reference/runtime/intro) providing utility methods for window manipulation, eventing, dialogs, menus and logging. +- Support for [obfuscating](/docs/guides/obfuscated) your application using [garble](https://github.com/burrowers/garble). +- Support for compressing your application using [UPX](https://upx.github.io/). +- Automatic Typescript generation of Go structs. More info [here](/docs/howdoesitwork#calling-bound-go-methods). +- No extra libraries or DLLs are required to be shipped with your application. For any platform. +- No requirement to bundle frontend assets. Just develop your application like any other web application. + +# Credit & Thanks + +Getting to v2 has been a huge effort. There have been ~2.2K commits by 89 contributors between the initial alpha and the release today, and many, many more that have provided translations, testing, feedback and help on the discussion forums as well as the issue tracker. I'm so unbelievably grateful to each one of you. I'd also like to give an extra special thank you to all the project sponsors who have provided guidance, advice and feedback. Everything you do is hugely appreciated. + +There are a few people I'd like to give special mention to: + +Firstly, a **huge** thank you to [@stffabi](https://github.com/stffabi) who has provided so many contributions which we all benefit from, as well as providing a lot of support on many issues. He has provided some key features such as the external dev server support which transformed our dev mode offering by allowing us to hook into [Vite](https://vitejs.dev/)'s superpowers. It's fair to say that Wails v2 would be a far less exciting release without his [incredible contributions](https://github.com/wailsapp/wails/commits?author=stffabi&since=2020-01-04). Thank you so much @stffabi! + +I'd also like to give a huge shout-out to [@misitebao](https://github.com/misitebao) who has tirelessly been maintaining the website, as well as providing Chinese translations, managing Crowdin and helping new translators get up to speed. This is a hugely important task, and I'm extremely grateful for all the time and effort put into this! You rock! + +Last, but not least, a huge thank you to Mat Ryer who has provided advice and support during the development of v2. Writing xBar together using an early Alpha of v2 was helpful in shaping the direction of v2, as well as give me an understanding of some design flaws in the early releases. I'm happy to announce that as of today, we will start to port xBar to Wails v2, and it will become the flagship application for the project. Cheers Mat! + +# Lessons Learnt + +There are a number of lessons learnt in getting to v2 that will shape development moving forward. + +## Smaller, Quicker, Focused Releases + +In the course of developing v2, there were many features and bug fixes that were developed on an ad-hoc basis. This led to longer release cycles and were harder to debug. Moving forward, we are going to create releases more often that will include a reduced number of features. A release will involve updates to documentation as well as thorough testing. Hopefully, these smaller, quicker, focussed releases will lead to fewer regressions and better quality documentation. + +## Encourage Engagement + +When starting this project, I wanted to immediately help everyone who had a problem. Issues were "personal" and I wanted them resolved as quickly as possible. This is unsustainable and ultimately works against the longevity of the project. Moving forward, I will be giving more space for people to get involved in answering questions and triaging issues. It would be good to get some tooling to help with this so if you have any suggestions, please join in the discussion [here](https://github.com/wailsapp/wails/discussions/1855). + +## Learning to say No + +The more people that engage with an Open Source project, the more requests there will be for additional features that may or may not be useful to the majority of people. These features will take an initial amount of time to develop and debug, and incur an ongoing maintenance cost from that point on. I myself am the most guilty of this, often wanting to "boil the sea" rather than provide the minimum viable feature. Moving forward, we will need to say "No" a bit more to adding core features and focus our energies on a way to empower developers to provide that functionality themselves. We are looking seriously into plugins for this scenario. This will allow anyone to extend the project as they see fit, as well as providing an easy way to contribute towards the project. + +# Looking to the Future + +There are so many core features we are looking at to add to Wails in the next major development cycle already. The [roadmap](https://github.com/wailsapp/wails/discussions/1484) is full of interesting ideas, and I'm keen to start work on them. One of the big asks has been for multiple window support. It's a tricky one and to do it right, and we may need to look at providing an alternative API, as the current one was not designed with this in mind. Based on some preliminary ideas and feedback, I think you'll like where we're looking to go with it. + +I'm personally very excited at the prospect of getting Wails apps running on mobile. We already have a demo project showing that it is possible to run a Wails app on Android, so I'm really keen to explore where we can go with this! + +A final point I'd like to raise is that of feature parity. It has long been a core principle that we wouldn't add anything to the project without there being full cross-platform support for it. Whilst this has proven to be (mainly) achievable so far, it has really held the project back in releasing new features. Moving forward, we will be adopting a slightly different approach: any new feature that cannot be immediately released for all platforms will be released under an experimental configuration or API. This allows early adopters on certain platforms to try the feature and provide feedback that will feed into the final design of the feature. This, of course, means that there are no guarantees of API stability until it is fully supported by all the platforms it can be supported on, but at least it will unblock development. + +# Final Words + +I'm really proud of what we've been able to achieve with the V2 release. It's amazing to see what people have already been able to build using the beta releases so far. Quality applications like [Varly](https://varly.app/), [Surge](https://getsurge.io/) and [October](https://october.utf9k.net/). I encourage you to check them out. + +This release was achieved through the hard work of many contributors. Whilst it is free to download and use, it has not come about through zero cost. Make no mistakes, this project has come at considerable cost. It has not only been my time and the time of each and every contributor, but also the cost of absence from friends and families of each of those people too. That's why I'm extremely grateful for every second that has been dedicated to making this project happen. The more contributors we have, the more this effort can be spread out and the more we can achieve together. I'd like to encourage you all to pick one thing that you can contribute, whether it is confirming someone's bug, suggesting a fix, making a documentation change or helping out someone who needs it. All of these small things have such a huge impact! It would be so awesome if you too were part of the story in getting to v3. + +Enjoy! + +‐ Lea + +PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks! diff --git a/website/i18n/ru/docusaurus-plugin-content-blog/authors.yml b/website/i18n/ru/docusaurus-plugin-content-blog/authors.yml new file mode 100644 index 00000000..a1621fab --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-blog/authors.yml @@ -0,0 +1,10 @@ +leaanthony: + name: Lea Anthony + title: Maintainer of Wails + url: https://github.com/leaanthony + image_url: https://github.com/leaanthony.png +misitebao: + name: Misite Bao + title: Architect + url: https://github.com/misitebao + image_url: https://github.com/misitebao.png diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current.json b/website/i18n/ru/docusaurus-plugin-content-docs/current.json index df52fbac..229bbfe7 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/current.json +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current.json @@ -1,14 +1,14 @@ { "version.label": { - "message": "Next", + "message": "Next Version 🚧", "description": "The label for version current" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "Приступая к работе", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "Справочник", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { @@ -16,23 +16,23 @@ "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "Сообщество", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { - "message": "Showcase", + "message": "Примеры", "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "Инструкции", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "Учебные материалы", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "Помощь проекту", "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-docs/current/community/links.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/links.mdx new file mode 100644 index 00000000..af3f57c2 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/links.mdx @@ -0,0 +1,26 @@ +--- +sidebar_position: 2 +--- + +# Ссылки + +Эта страница служит списком ссылок на сообщество. Пожалуйста, отправьте PR (нажмите `Редактировать эту страницу` внизу) для отправки ссылок. + +## Awesome Wails + +[Полный список](https://github.com/wailsapp/awesome-wails) ссылок, связанных с Wails. + +## Каналы поддержки + +- [Gophers Slack Channel](https://gophers.slack.com/messages/CJ4P9F7MZ/) +- [Gophers Slack Channel Invite](https://invite.slack.golangbridge.org/) +- [Github Issues](https://github.com/wailsapp/wails/issues) +- [v2 Beta Discussion Board](https://github.com/wailsapp/wails/discussions/828) + +## Социальные сети + +- [Twitter](https://twitter.com/wailsapp) +- [Wails группа в QQ китайского сообщества](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Номер группы: 1067173054 + +## Другие руководства и статьи +- [Создание доски объявлений](https://blog.customct.com/building-bulletin-board) diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx new file mode 100644 index 00000000..04150ba2 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/emailit.mdx @@ -0,0 +1,10 @@ +# EmailIt + +```mdx-code-block +

+ +
+

+``` + +[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 builtin [Node-Red](https://nodered.org/) server, scripts terminal, and the [ScriptBar](https://github.com/raguay/ScriptBarApp) program for displaying results from Node-Red or a script on your system. Documentation is very scarce, but the programs works. It’s built using Wails2 and Svelte, and the download is a universal macOS application. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx new file mode 100644 index 00000000..a03cc9be --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/encrypteasy.mdx @@ -0,0 +1,12 @@ +# EncryptEasy + +```mdx-code-block +

+ +
+

+``` + +**[EncryptEasy](https://www.encrypteasy.app) - это простой и простой в использовании PGP инструмент шифрования, управления вашими ключами и ключами ваших контактов. Шифрование не должно быть сложным процессом для пользователя. Разработано на Wails.** + +Шифрование сообщений с помощью PGP является стандартом отрасли. У каждого есть приватный и публичный ключ. Ваш приватный ключ должен оставаться в секрете, для того, чтобы только вы могли читать сообщения. Ваш публичный ключ передается всем, кто хочет отправлять вам секретные и зашифрованные сообщения. Управление ключами, шифрованием сообщений и расшифровкой сообщений должно бесперебойно работать. EncryptEasy - это то, что позволяет сделать это с лёгкостью. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx new file mode 100644 index 00000000..1c5b0c33 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/filehound.mdx @@ -0,0 +1,16 @@ +# FileHound утилита для экспорта данных + +```mdx-code-block +

+ +
+

+``` + +[FileHound утилита для экспорта данных](https://www.filehound.co.uk/) FileHound это облачная платформа управления документами для безопасного сохранения файлов, автоматизации бизнес-процессов и SmartCapture возможностей. + +Утилита экспорта данных из FileHound позволяет администраторам запустить безопасное извлечение документов и данных для альтернативного варианта создания бэкапов и восстановления данных. Это приложение загруит все документы и/или метаданные, сохраненные в FileHound основываясь на выбранных фильтрах. Метадата будет извлечена в форматах XML и JSON. + +Бэкенд: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2 + +Фронтенд: Vue 2.6.11 Vuex 3.4.0 Typescript Tailwind 1.9.6 diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx new file mode 100644 index 00000000..b79e123c --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/minecraftupdater.mdx @@ -0,0 +1,14 @@ +# Minecraft Updater + +```mdx-code-block +

+ +
+

+``` + +[Minecraft Updater](https://github.com/Gurkengewuerz/MinecraftModUpdater) — утилита для обновления и синхронизации Minecraft модов для вашей пользовательской базы. Она построена с помощью Wails2 и React с [antd](https://ant.design/) в качестве фронтенд фреймворка. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx new file mode 100644 index 00000000..5f9016f3 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/modalfilemanager.mdx @@ -0,0 +1,14 @@ +# Modal File Manager + +```mdx-code-block +

+ +
+

+``` + +[Modal File Manager](https://github.com/raguay/ModalFileManager) — это двухпанельный файловый менеджер с использованием веб-технологий. Мой оригинальный дизайн был основан на NW.js, и его можно найти [здесь](https://github.com/raguay/ModalFileManager-NWjs). В этой версии используется тот же код интерфейса Svelte (но с момента выхода из NW.), но бэкенд - это реализация [Wails 2](https://wails.io/). Используя эту реализацию, я больше не использую командную строку и команды: `rm`, `cp`, и т. д. Он полностью закодирован с помощью Go и работает гораздо быстрее, чем предыдущие версии. + +Этот файловый менеджер построен вокруг того же принципа, что и Vim: управление состоянием клавиатурных действий. Количество состояний не фиксировано, но очень программируется. Поэтому может быть создано и использовано бесконечное количество конфигураций клавиатуры. Это главное отличие от других файловых менеджеров. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx new file mode 100644 index 00000000..2795fc62 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/mollywallet.mdx @@ -0,0 +1,10 @@ +# Molley Wallet + +```mdx-code-block +

+ +
+

+``` + +[Molly Wallet](https://github.com/grvlle/constellation_wallet/) официальный кошелек $DAG сети Constellation. Это позволит пользователям взаимодействовать с Hypergraph Network различными способами, не ограничиваясь $DAG транзакциями. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/october.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/october.mdx new file mode 100644 index 00000000..b9dbea1f --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/october.mdx @@ -0,0 +1,14 @@ +# October + +```mdx-code-block +

+ +
+

+``` + +[October](https://october.utf9k.net) - это небольшая программа Wails, которая позволяет извлечь выделения из [Kobo eReaders](https://en.wikipedia.org/wiki/Kobo_eReader) и затем переслать их в [Readwise](https://readwise.io). + +Он обладает относительно небольшим охватом со всеми версиями платформы, весом менее 10 МБ, и это без включения [UPX сжатия](https://upx.github.io/)! + +В отличие от этого, предыдущие попытки автора с Electron быстро вылились в несколько сот мегабайт. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx new file mode 100644 index 00000000..24a41cbd --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/optimus.mdx @@ -0,0 +1,10 @@ +# Optimus + +```mdx-code-block +

+ +
+

+``` + +[Optimus](https://github.com/splode/optimus) - приложение для оптимизации изображений. Он поддерживает конвертацию и сжатие изображений между форматами WebP, JPEG и PNG. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx new file mode 100644 index 00000000..1a9fa1eb --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/portfall.mdx @@ -0,0 +1,10 @@ +# Portfall + +```mdx-code-block +

+ +
+

+``` + +[Portfall](https://github.com/rekon-oss/portfall) - Портпад k8s портал для перенаправления портов для легкого доступа ко всем интерфейсам кластера diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx new file mode 100644 index 00000000..5461ccf1 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/restic-browser.mdx @@ -0,0 +1,12 @@ +# Restic Browser + +```mdx-code-block +

+ +
+

+``` + +[Restic-Browser](https://github.com/emuell/restic-browser) - Простой кросс-платформенный интерфейс для [restic](https://github.com/restic/restic) для просмотра и восстановления оставшихся репозиториев. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx new file mode 100644 index 00000000..1b234072 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/riftshare.mdx @@ -0,0 +1,21 @@ +# RiftShare + +```mdx-code-block +

+ +
+

+``` + +Простой, безопасный и бесплатный обмен файлами для всех. Узнайте больше на [Riftshare.app](https://riftshare.app) + +## Возможности + +- Легкий обмен файлами между компьютерами как в локальной сети, так и через Интернет +- Поддерживает безопасную отправку файлов или директорий через [magic wormhole протокол](https://magic-wormhole.readthedocs.io/en/latest/) +- Совместимо со всеми приложениями, использующими magic wormhole (magic-wormhole или wormhole-william CLI, wormhole-gui и т. д.) +- Автоматическое сжатие нескольких выбранных файлов для одновременной отправки +- Полная анимация, индикатор прогресса и поддержка отмены для отправки и получения +- Нативное окно выбора файла +- Открытие файлов в один клик после получения +- Автоматическое обновление - не беспокойтесь о получении последней версии! diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx new file mode 100644 index 00000000..3069a480 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/scriptbar.mdx @@ -0,0 +1,10 @@ +# ScriptBar + +```mdx-code-block +

+ +
+

+``` + +[ScriptBar](https://GitHub.com/raguay/ScriptBarApp) это программа для отображения вывода встроенного сервера [Node-Red](https://nodered.org) в приложении [EmailIt](https://GitHub.com/raguay/EmailIt). Он также отображает вывод скриптов в вашей системе. ScriptBar не помещает их в меню, но все они в удобном окне для удобного просмотра. Вы можете открыть несколько вкладок, чтобы показать множество различных вещей. Вы также можете держать ссылки на наиболее посещаемые вами веб-сайты. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx new file mode 100644 index 00000000..8f77bfb8 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/surge.mdx @@ -0,0 +1,10 @@ +# Surge + +```mdx-code-block +

+ +
+

+``` + +[Surge](https://getsurge.io/) это p2p приложение для обмена файлов, разработанное для использования блокчейн технологий для 100% анонимной передачи файлов. Surge зашифрован сквозным шифрованием, децентрализован и с открытым исходным кодом. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx new file mode 100644 index 00000000..1d112481 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wally.mdx @@ -0,0 +1,10 @@ +# Wally + +```mdx-code-block +

+ +
+

+``` + +[Wally](https://ergodox-ez.com/pages/wally) это официальное приложение для прошивки [Ergodox](https://ergodox-ez.com/) клавиатур. Это великолепный и фантастический пример того, чего вы можете достичь с помощью Wails: возможности сочетать мощь Go и богатые графические инструменты мира веб-разработки. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx new file mode 100644 index 00000000..f526142e --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/wombat.mdx @@ -0,0 +1,10 @@ +# Wombat + +```mdx-code-block +

+ +
+

+``` + +[Wombat](https://github.com/rogchap/wombat) - это кроссплатформенный клиент gRPC. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx new file mode 100644 index 00000000..15be62e0 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/showcase/ytd.mdx @@ -0,0 +1,10 @@ +# Ytd + +```mdx-code-block +

+ +
+

+``` + +[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails) это приложение для скачивания треков с youtube, создания оффлайн плейлистов и обмена ими с друзьями, ваши друзья смогут воспроизвести ваши плейлисты или загрузить их для оффлайн прослушивания, имеет встроенный плеер. 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 new file mode 100644 index 00000000..e4a7dd18 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/community/templates.mdx @@ -0,0 +1,56 @@ +--- +sidebar_position: 1 +--- + +# Шаблоны + +Эта страница служит списком шаблонов, поддерживаемых сообществом. Пожалуйста, отправьте PR (нажмите `Изменить эту страницу` внизу) чтобы включить ваши шаблоны. Чтобы создать свой собственный шаблон, см. [руководство по шаблонам](../guides/templates.mdx). + +Чтобы использовать эти шаблоны, запустите `wails init -n "Название вашего проекта" -t [ссылка ниже[@version]]` + +Если нет суффикса версии, по умолчанию используется основной шаблон кода ветки. При наличии суффикса версии используется кодовый шаблон, соответствующий тегу этой версии. + +Пример: `wails init -n "Project Name" -t https://github.com/misitebao/wails-template-vue` + +::warning Внимание + +**Проект Wails не поддерживает и не несет ответственности за сторонние шаблоны!** + +Если вы не уверены в шаблоне, проверьте `package.json` и `wails.json` на какие скрипты запускаются и какие пакеты установлены. + +::: + +## Vue + +- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - шаблон, основанный на Vue ecology (ИнтегрированTypeScript, Темная тема, интернационализация, маршрутизация для одной страницы, TailwindCSS) +- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript с Vite (и инструкции для добавления функций) +- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript с Vite, Vuex, Vue Router, Sass, и ESLint + Prettier +- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - A template using JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier) +- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - A template using TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API with <script setup>) + +## Angular + +- [wails-угловый-template](https://github.com/TAINCER/wails-angular-template) - Angular с TypeScript, Sass, Hot-Reload, Code-Splitting и i18n + +## React + +- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - Шаблон с использованием reactjs +- [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 + +## 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-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - шаблон с использованием SvelteKit + +## Elm + +- [wails-elm-шаблон](https://github.com/benjamin-thomas/wails-elm-template) - Разработайте ваше GUI приложение с функциональным программированием и **snappy** настройками горячей перезагрузки :tada: :rocket: +- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Объединение возможностей :muscle: Elm + Tailwind CSS + Wails! Поддерживается горячая перезагрузка. + +## Чистый JavaScript (Vanilla) + +- [wails-pure-js-шаблон](https://github.com/KiddoV/wails-pure-js-template) - шаблон, содержащий только базовый JavaScript, HTML и CSS diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx new file mode 100644 index 00000000..11122314 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/building.mdx @@ -0,0 +1,22 @@ +--- +sidebar_position: 6 +--- + +# Компиляция проекта + +Из каталога проекта запустите `wails build`. Это позволит скомпилировать ваш проект и сохранить готовый к выпуску бинарный файл в директории `build/bin`. + +Если вы запустите исполняемый файл, вы увидите приложение по умолчанию: + +```mdx-code-block +
+ +
+
+``` + +Для получения более подробной информации о параметрах компиляции обратитесь к [CLI Reference](../reference/cli.mdx#build). diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx new file mode 100644 index 00000000..38fcccd7 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/development.mdx @@ -0,0 +1,16 @@ +--- +sidebar_position: 5 +--- + +# Разработка вашего приложения + +Вы можете запустить ваше приложение в режиме разработки, выполнив `wails dev` в вашем каталоге проекта. Это сделает следующие вещи: + +- Соберет ваше приложение и запустит +- Привяжет код Go к интерфейсу, чтобы его можно было вызвать из Javascript +- С помощью [Vite](https://vitejs.dev/), будет наблюдать за изменениями в ваших Go файлах и пересобирать/перезапускать при изменении +- Устанавливает [веб-сервер](http://localhost:34115), который будет обслуживать ваше приложение через браузер. Это позволит вам использовать ваши любимые расширения браузера. Вы даже можете вызвать ваш Go-код из консоли + +Для начала запустите `wails dev` в каталоге проекта. Более подробную информацию об этом можно найти [здесь](../reference/cli.mdx#dev). + +Скоро: Инструкция diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx new file mode 100644 index 00000000..46578196 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/firstproject.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 2 +--- + +# Создание проекта + +## Генерация проекта + +Теперь, когда CLI установлен, вы можете создать новый проект, используя команду `wails init`. + +Выберите Ваш любимый фреймворк: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Генерируем Svelte проект с использованием Javascript с помощью команды:

+ + wails init -n myproject -t svelte + +Если вы также используете Typescript:
+ + wails init -n myproject -t svelte-ts + +
+ + Генерируем a React проект с использованием Javascript with:

+ + wails init -n myproject -t react + +Если вы также используете Typescript:
+ + wails init -n myproject -t react-ts + +
+ + Генерируем Vue проект с использованием Javascript with:

+ + wails init -n myproject -t vue + +Если вы также используете Typescript:
+ + wails init -n myproject -t vue-ts + +
+ + Генерируем Preact проект с использованием Javascript with:

+ + wails init -n myproject -t preact + +Если вы также используете Typescript:
+ + wails init -n myproject -t preact-ts + +
+ + Генерируем Lit проект с использованием Javascript with:

+ + wails init -n myproject -t lit + +Если вы также используете Typescript:
+ + wails init -n myproject -t lit-ts + +
+ + Генерируем проект с Vanilla и Javascript with:

+ + wails init -n myproject -t vanilla + +Если вы также используете Typescript:
+ + wails init -n myproject -t vanilla-ts + +
+
+``` + +
+ +Доступны также [шаблоны сообщества](../community/templates.mdx), которые предлагают различные возможности и фреймворки. + +Чтобы увидеть другие доступные опции, вы можете запустить `wails init -help`. Более подробную информацию можно найти в [CLI Reference](../reference/cli.mdx#init). + +## Структура проекта + +Проекты Wails имеют следующую структуру: + +``` +. +├── build/ +│ ├── appicon.png +│ ├── darwin/ +│ └── windows/ +├── frontend/ +├── go.mod +├── go.sum +├── main.go +└── wails.json +``` + +### Краткое описание структуры проекта + +- `/main.go` - основное приложение +- `/frontend/` - фронтенд файлы проекта +- `/build/` - директория сборки проекта +- `/build/appicon.png` - значок приложения +- `/build/darwin/` - файлы проекта для Mac +- `/build/windows/` - файлы проектов, специфичных для Windows +- `/wails.json` - Конфигурация проекта +- `/go.mod` - Go module файл +- `/go.sum` - Go module проверочная сумма + +Каталог `frontend` ничего не имеет специфического для Wails и может быть любым пользовательским проектом по вашему выбору. + +Каталог `build` используется в процессе сборки. Эти файлы можно обновить, чтобы настроить ваши сборки. Если удалить файлы из директории, они будут заново сгенерированы с версией по-умолчанию. + +Название модуля по умолчанию в `go.mod` - это "changeme". Вы должны изменить это на нечто более подходящее. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx new file mode 100644 index 00000000..0d746c44 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/gettingstarted/installation.mdx @@ -0,0 +1,90 @@ +--- +sidebar_position: 1 +--- + +# Инструкция по установке + +## Поддерживаемые платформы + +- Windows 10/11 AMD64/ARM64 +- MacOS 10.13+ AMD64 +- MacOS 11.0+ ARM64 +- Linux AMD64/ARM64 + +## Зависимости + +Wails имеет ряд общих зависимостей, которые необходимы перед установкой: + +- Go 1.18+ +- NPM (Node 15+) + +### Go + +Скачайте Go с [Go Downloads Page](https://go.dev/dl/). + +Убедитесь, что вы следуете официальным [Инструкциям по установке](https://go.dev/doc/install). Вам также нужно убедиться, что ваша переменная окружения `PATH` также включает путь к вашему каталогу `~/go/bin`. Перезапустите терминал и выполните следующие шаги: + +- Проверьте то, что Go установлен правильно: `go version` +- Проверьте "~/go/bin" в переменной PATH: `echo $PATH | grep go/bin` + +### NPM + +Загрузите NPM отсюда: [Node Downloads Page](https://nodejs.org/en/download/). Лучше использовать последнюю версию, так как это то, что мы её обычно тестируем. + +Запустите `npm --version` для проверки. + +## Зависимости платформы + +Вам также нужно установить специфичные для платформы зависимости: + +```mdx-code-block +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + Wails требует установки инструментов xcode command line tools. Их можно установить, + запустив xcode-select --install. + + + Wails требует установки WebView2. В некоторых установках Windows это уже установлено. Вы можете проверить используя команду wails doctor. + + + Linux требуется стандарт gcc инструменты сборки, а так же libgtk3 и libwebkit. Вместо того чтобы перечислять огромное количество команд для разных дистрибутивов, Wails может попробовать определить команды установки, специфичные для вашего дистрибутива. Запустите wails doctor после установки, чтобы узнать, как установить зависимости. Если ваш дистрибутив или менеджер пакетов не поддерживается, пожалуйста, обратитесь к руководству {" "} Добавление дистрибутива Linux. + + +``` + +## Необязательные зависимости + +- [UPX](https://upx.github.io/) для сжатия приложений. +- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers. + +## Установка Wails + +Выполните `go install github.com/wailsapp/wails/v2/cmd/wails@latest` для установки Wails CLI. + +Примечание: Если вы получите ошибку, похожую на эту: + +```shell +....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found +``` +пожалуйста, убедитесь, что у вас установлен Go 1.18+: +```shell +go version +``` + +## Проверка системы + +Запуск `wails doctor` проверит установлены ли у вас правильные зависимости. Если нет, то он покажет что не хватает, и покажет как исправить какие-либо проблемы. + +## Отсутствует команда `wails`? + +Если ваша система пишет, что команда `wails` отсутствует, удостоверьтесь, что вы корректно следовали инструкции по установке Go. Обычно это значит, что папка `go/bin`, находящаяся в домашней папке пользователя не добавлена в переменную окружения `PATH`. Обычно после изменения переменных окружения нужно переоткрыть командную строку, чтобы изменения применились в ней. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/angular.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/angular.mdx new file mode 100644 index 00000000..4d56b65b --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/angular.mdx @@ -0,0 +1,14 @@ +# Angular + +Хотя у Wails нет шаблона с Angular, тем не менее Angular использовать возможно. + +## Режим разработчика + +Чтобы получить режим dev работы с Angular, вам нужно добавить следующие значения к `wails.json`: + +```json + "frontend:build": "npx ng build", + "frontend:install": "npm install", + "frontend:dev:watcher": "npx ng serve", + "frontend:dev:serverUrl": "http://localhost:4200", +``` \ No newline at end of file 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 new file mode 100644 index 00000000..00c77ef5 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/application-development.mdx @@ -0,0 +1,194 @@ +# Разработка приложения + +Нет жестких и быстрых правил для разработки приложений с помощью Wails, но есть некоторые основные принципы. + +## Application Setup + +The pattern used by the default templates are that `main.go` is used for configuring and running the application, whilst `app.go` is used for defining the application logic. + +The `app.go` file will define a struct that has 2 methods which act as hooks into the main application: + +```go title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} +``` + +- The startup method is called as soon as Wails allocates the resources it needs and is a good place for creating resources, setting up event listeners and anything else the application needs at startup. It is given a `context.Context` which is usually saved in a struct field. This context is needed for calling the [runtime](../reference/runtime/intro.mdx). If this method returns an error, the application will terminate. In dev mode, the error will be output to the console. + +- The shutdown method will be called by Wails right at the end of the shutdown process. This is a good place to deallocate memory and perform any shutdown tasks. + +The `main.go` file generally consists of a single call to `wails.Run()`, which accepts the application configuration. The pattern used by the templates is that before the call to `wails.Run()`, an instance of the struct we defined in `app.go` is created and saved in a variable called `app`. This configuration is where we add our callbacks: + +```go {3,9,10} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks). + +## Binding Methods + +It is likely that you will want to call Go methods from the frontend. This is normally done by adding public methods to the already defined struct in `app.go`: + +```go {16-18} title="app.go" +type App struct { + ctx context.Context +} + +func NewApp() *App { + return &App{} +} + +func (a *App) startup(ctx context.Context) { + a.ctx = ctx +} + +func (a *App) shutdown(ctx context.Context) { +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +In the main application configuration, the `Bind` key is where we can tell Wails what we want to bind: + +```go {11-13} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods). + +### Dealing with context when binding multiple structs + +If you want to bind methods for multiple structs but want each struct to keep a reference to the context so that you can use the runtime functions, a good pattern is to pass the context from the `OnStartup` method to your struct instances : + +```go +func main() { + + app := NewApp() + otherStruct := NewOtherStruct() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: func(ctx context.Context){ + app.SetContext(ctx) + otherStruct.SetContext(ctx) + }, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + otherStruct + }, + }) + if err != nil { + log.Fatal(err) + } +} +``` + +More information on Binding can be found [here](../howdoesitwork.mdx#method-binding). + +## Application Menu + +Wails supports adding a menu to your application. This is done by passing a [Menu](../reference/menus.mdx#menu) struct to application config. It's common to use a method that returns a Menu, and even more common for that to be a method on the `App` struct used for the lifecycle hooks. + +```go {11} title="main.go" +func main() { + + app := NewApp() + + err := wails.Run(&options.App{ + Title: "My App", + Width: 800, + Height: 600, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Menu: app.menu(), + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + +``` + +## Assets + +The great thing about the way Wails v2 handles assets is that it doesn't! The only thing you need to give Wails is an `embed.FS`. How you get to that is entirely up to you. You can use vanilla html/css/js files like the vanilla template. You could have some complicated build system, it doesn't matter. + +When `wails build` is run, it will check the `wails.json` project file at the project root. There are 2 keys in the project file that are read: + +- "frontend:install" +- "frontend:build" + +The first, if given, will be executed in the `frontend` directory to install the node modules. The second, if given, will be executed in the `frontend` directory to build the frontend project. + +If these 2 keys aren't given, then Wails does absolutely nothing with the frontend. It is only expecting that `embed.FS`. + +### AssetsHandler + +A Wails v2 app can optionally define a `http.Handler` in the `options.App`, which allows hooking into the AssetServer to create files on the fly or process POST/PUT requests. GET requests are always first handled by the `assets` FS. If the FS doesn't find the requested file the request will be forwarded to the `http.Handler` for serving. Any requests other than GET will be directly processed by the `AssetsHandler` if specified. It's also possible to only use the `AssetsHandler` by specifiy `nil` as the `Assets` option. + +## Built in Dev Server + +Running `wails dev` will start the built in dev server which will start a file watcher in your project directory. By default, if any file changes, wails checks if it was an application file (default: `.go`, configurable with `-e` flag). If it was, then it will rebuild your application and relaunch it. If the changed file was in the assets, it will issue a reload after a short amount of time. + +The dev server uses a technique called "debouncing" which means it doesn't reload straight away, as there may be multiple files changed in a short amount of time. When a trigger occurs, it waits for a set amount of time before issuing a reload. If another trigger happens, it resets to the wait time again. By default this value is `100ms`. If this value doesn't work for your project, it can be configured using the `-debounce` flag. If used, this value will be saved to your project config and become the default. + +## 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. + +## Go Module + +The default Wails templates generate a `go.mod` file that contains the module name "changeme". You should change this to something more appropriate after project generation. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx new file mode 100644 index 00000000..b7316b30 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/dynamic-assets.mdx @@ -0,0 +1,136 @@ +# Динамические ресурсы + +Если вы хотите загрузить или генерировать ресурсы для вашего фронтенда динамически, вы можете это сделать, используя опцию [AssetsHandler](../reference/options#assetshandler). AssetsHandler это общий `http.Handler`, который будет вызываться для любого запроса, не являющегося GET, на сервере ресурсов и для запросов GET, которые не могут быть обработаны из бандла ресурсов, поскольку файл не найден. + +Установив пользовательские AssetsHandler, вы можете предоставлять свои собственные ресурсы с помощью пользовательского ресурсного сервера. + +## Пример + +В нашем примере мы создадим простой обработчик ресурсов, который загрузит файлы с диска: + +```go title=main.go {16-35,49} +package main + +import ( + "embed" + "fmt" + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "net/http" + "os" + "strings" +) + +//go:embed all:frontend/dist +var assets embed.FS + +type FileLoader struct { + http.Handler +} + +func NewFileLoader() *FileLoader { + return &FileLoader{} +} + +func (h *FileLoader) ServeHTTP(res http.ResponseWriter, req *http.Request) { + var err error + requestedFilename := strings.TrimPrefix(req.URL.Path, "/") + println("Requesting file:", requestedFilename) + fileData, err := os.ReadFile(requestedFilename) + if err != nil { + res.WriteHeader(http.StatusBadRequest) + res.Write([]byte(fmt.Sprintf("Could not load file %s", requestedFilename))) + } + + res.Write(fileData) +} + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "helloworld", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: NewFileLoader(), + }, + BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 255}, + OnStartup: app.startup, + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +Когда мы запустим приложение в dev режиме, с помощью команды `wails dev`, мы увидим следующий вывод: + +``` +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' +DEB | [ExternalAssetHandler] Loading 'http://localhost:3001/favicon.ico' failed, using AssetHandler +Requesting file: favicon.ico +``` + +Как видите, обработчик ресурсов вызывается, когда стандартный сервер ресурсов не может предоставить файл `favicon.ico`. + +Если вы щелкните правой кнопкой мыши по окну приложения и выберите "Исследовать элемент" для вызова devtools, вы сможете протестировать эту функцию, введя в консоль следующую строку: + +``` +let response = await fetch('does-not-exist.txt'); +``` + +Это сгенерирует ошибку в devtools. Мы видим ошибку обработчика пользовательских ресурсов, которую мы ожидали увидеть: + +```mdx-code-block +

+ +

+``` + +Однако, если мы вызовем `go.mod`, мы увидим следующий вывод: + +```mdx-code-block +

+ +

+``` + +А так мы можем разместить изображение прямо на страницу. Если мы обновим шаблон по умолчанию и заменим изображение логотипа: + +```html + +``` + +на: + +```html + +``` + +Тогда мы увидим следующее: + +```mdx-code-block +

+ +

+``` + +:::warning + +Раскрытие структуры файловой системы таким образом сопряжено с рисками безопасности. Рекомендуется правильно управлять доступом к файловой системе. + +::: diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frameless.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frameless.mdx new file mode 100644 index 00000000..3845736f --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frameless.mdx @@ -0,0 +1,87 @@ +# Frameless Applications + +Wails supports application that have no frames. This can be achieved by using the [frameless](../reference/options.mdx#frameless) field in [Application Options](../reference/options.mdx#application-options). + +Wails offers a simple solution for dragging the window: Any HTML element that has the CSS style `--wails-draggable:drag` will act as a "drag handle". This property applies to all child elements. If you need to indicate that a nested element should not drag, then use the attribute '--wails-draggable:no-drag' on that element. + +```html + + + + + + + +
+ + +
+
+ + + + +``` + +For some projects, using a CSS variable may not be possible due to dynamic styling. In this case, you can use the `CSSDragProperty` and `CSSDragValue` application options to define a property and value that will be used to indicate draggable regions: + +```go title=main.go +package main + +import ( + "embed" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + // Create an instance of the app structure + app := NewApp() + + // Create application with options + err := wails.Run(&options.App{ + Title: "alwaysontop", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Frameless: true, + CSSDragProperty: "widows", + CSSDragValue: "1", + Bind: []interface{}{ + app, + }, + }) + + if err != nil { + println("Error:", err) + } +} +``` + +```html title=index.html + + + + + + alwaysontop + + +
+ + + +``` + +:::info Fullscreen + +If you allow your application to go fullscreen, this drag functionality will be disabled. + +::: diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frontend.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frontend.mdx new file mode 100644 index 00000000..ac087ee4 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/frontend.mdx @@ -0,0 +1,72 @@ +# Frontend + +## Script Injection + +When Wails serves your `index.html`, by default, it will inject 2 script entries into the `` tag to load `/wails/ipc.js` and `/wails/runtime.js`. These files install the bindings and runtime respectively. + +The code below shows where these are injected by default: + +```html + + + injection example + + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + +``` + +### Overriding Default Script Injection + +To provide more flexibility to developers, there is a meta tag that may be used to customise this behaviour: + +```html + +``` + +The options are as follows: + +| Value | Description | +| ------------------- | ------------------------------------------------ | +| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` | +| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` | +| noautoinject | Disable all autoinjection of scripts | + +Multiple options may be used provided they are comma seperated. + +This code is perfectly valid and operates the same as the autoinjection version: + +```html + + + injection example + + + + + + +
Please enter your name below 👇
+
+ + +
+ + + + + + +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/ides.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/ides.mdx new file mode 100644 index 00000000..9319fbb2 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/ides.mdx @@ -0,0 +1,127 @@ +# IDEs + +Wails aims to provide a great development experience. To that aim, we now support generating IDE specific configuration to provide smoother project setup. + +Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but aim to support other IDEs such as Goland. + +## Visual Studio Code + +```mdx-code-block +

+ +

+``` + +When generating a project using the `-ide vscode` flags, IDE files will be created alongside the other project files. Эти файлы помещаются в директорию `.vscode` и предоставляют правильную конфигурацию для отладки вашего приложения. + +The 2 files generated are `tasks.json` and `launch.json`. Below are the files generated for the default vanilla project: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/myproject.exe" + ] + } + ] +} +``` + +```json title="launch.json" +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Wails: Debug myproject", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/build/bin/myproject.exe", + "preLaunchTask": "build", + "cwd": "${workspaceFolder}", + "env": {} + } + ] +} +``` + +### Configuring the install and build steps + +The `tasks.json` file is simple for the default project as there is no `npm install` or `npm run build` step needed. For projects that have a frontend build step, such as the svelte template, we would need to edit `tasks.json` to add the install and build steps: + +```json title="tasks.json" +{ + "version": "2.0.0", + "tasks": [ + { + "label": "npm install", + "type": "npm", + "script": "install", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "npm run build", + "type": "npm", + "script": "build", + "options": { + "cwd": "${workspaceFolder}/frontend" + }, + "presentation": { + "clear": true, + "panel": "shared", + "showReuseMessage": false + }, + "problemMatcher": [] + }, + { + "label": "build", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}" + }, + "command": "go", + "args": [ + "build", + "-tags", + "dev", + "-gcflags", + "all=-N -l", + "-o", + "build/bin/vscode.exe" + ], + "dependsOn": ["npm install", "npm run build"] + } + ] +} +``` + +:::info Future Enhancement + +In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically. + +::: diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx new file mode 100644 index 00000000..10750baa --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux-distro-support.mdx @@ -0,0 +1,103 @@ +# Поддержка Linux + +## Обзор + +Wails предлагает поддержку Linux, но составить инструкции по установке для всех доступных дистрибутивов - это невыполнимая задача. Вместо этого Wails пытается определить, доступны ли пакеты для разработки через системный менеджер пакетов. В настоящее время мы поддерживаем следующие менеджеры пакетов: + +- apt +- dnf +- emerge +- eopkg +- nixpkgs +- pacman +- zypper + +## Добавление имен пакетов + +Может возникнуть ситуация, когда ваш дистрибутив использует один из поддерживаемых менеджеров пакетов, но имя пакета отличается от названия. Например, вы можете использовать производную от Ubuntu систему, но имя пакета для gtk может быть другим. Wails пытается найти правильный пакет, ища по списку имен пакетов. Список пакетов хранится в файле (packagemanager) в каталоге `v2/internal/system/packagemanager`. В нашем примере это `v2/internal/system/packagemanager/apt.go`. + +В этом файле список пакетов определяется методом `Packages()`: + +```go +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +Предположим, что в нашем Linux-дистрибутиве `libgtk-3` упакован под именем `lib-gtk3-dev`. Мы могли бы добавить поддержку для этого, добавив следующую строку: + +```go {5} +func (a *Apt) Packages() packagemap { + return packagemap{ + "libgtk-3": []*Package{ + {Name: "libgtk-3-dev", SystemPackage: true, Library: true}, + {Name: "lib-gtk3-dev", SystemPackage: true, Library: true}, + }, + "libwebkit": []*Package{ + {Name: "libwebkit2gtk-4.0-dev", SystemPackage: true, Library: true}, + }, + "gcc": []*Package{ + {Name: "build-essential", SystemPackage: true}, + }, + "pkg-config": []*Package{ + {Name: "pkg-config", SystemPackage: true}, + }, + "npm": []*Package{ + {Name: "npm", SystemPackage: true}, + }, + "docker": []*Package{ + {Name: "docker.io", SystemPackage: true, Optional: true}, + }, + } +} +``` + +## Добавление новых менеджеров пакетов + +Чтобы добавить новый менеджер пакетов, выполните следующие действия: + +- Создайте новый файл в `v2/internal/system/packagemanager` под названием `.go`, где `` это имя менеджера пакетов. +- Определите структуру, которая соответствует интерфейсу менеджера пакетов, определенному в `pm.go`: + +```go +type PackageManager interface { + Name() string + Packages() packagemap + PackageInstalled(*Package) (bool, error) + PackageAvailable(*Package) (bool, error) + InstallCommand(*Package) string +} +``` + +- `Name()` должен возвращать имя менеджера пакетов +- `Packages()` должен возвращать `packagemap`, который предоставляет имена файлов для зависимостей +- `PackageInstalled()` должен возвращать `true`, если данный пакет установлен +- `PackageAvailable()` должен возвращать `true`, если данный пакет не установлен, но доступен для установки +- `InstallCommand()` должен возвращать точную команду для установки данного пакета + +Взгляните на другие коды менеджеров пакетов, чтобы получить представление о том, как это работает. + +::info Помните + +Если вы добавите поддержку для нового менеджера пакетов, не забудьте также обновить эту страницу! + +::: diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux.mdx new file mode 100644 index 00000000..229c282b --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/linux.mdx @@ -0,0 +1,18 @@ +# Linux + +This page has miscellaneous guides related to developing Wails applications for Linux. + +## Video tag doesn't fire "ended" event + +When using a video tag, the "ended" event is not fired when the video is finished playing. This is a bug in WebkitGTK, however you can use the following workaround to fix it: + +```js +videoTag.addEventListener("timeupdate", (event) => { + if (event.target.duration - event.target.currentTime < 0.2) { + let ended = new Event("ended"); + event.target.dispatchEvent(ended); + } +}); +``` + +Source: [Lyimmi](https://github.com/Lyimmi) on the [discussions board](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275) diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/local-development.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/local-development.mdx new file mode 100644 index 00000000..724a5ae1 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/local-development.mdx @@ -0,0 +1,55 @@ +# Local Development + +## Обзор + +Wails is in constant development and new releases are regularly "tagged". This usually happens when all the newer code on `master` has been tested and confirmed working. If you need a bugfix or feature that has not yet made it to a release, it's possible to use the latest "bleeding edge" version using the following steps: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails/v2/cmd/wails` +- `go install` + +NOTE: The directory that you cloned the project into will now be called "clonedir". + +The Wails CLI will now be at the very latest version. + +### Updating your project + +To update projects to use the latest version of the Wails library, update the project's `go.mod` and ensure the following line is at the bottom of the file: + +`replace github.com/wailsapp/wails/v2 => ` + +Example: + +On Windows: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2` + +On 'nix: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2` + +To revert to a stable version, run: + +`go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +## Testing a Branch + +If you want to test a branch, follow the instructions above, but ensure you switch the branch you want to test before installing: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git checkout -b branch-to-test --track origin/branch-to-test` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. + +## Testing a PR + +If you want to test a PR, follow the instructions above, but ensure you fetch the PR and switch the branch before installing. Please replace `[IDofThePR]` with the ID of the PR shown on github.com: + +- `git clone https://github.com/wailsapp/wails` +- `cd wails` +- `git fetch -u origin pull/[IDofThePR]/head:test/pr-[IDofThePR]` +- `git checkout test/pr-[IDofThePR]` +- `git reset --hard HEAD` +- `cd v2/cmd/wails` +- `go install` + +Make sure you [update your project](#updating-your-project) as described above. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx new file mode 100644 index 00000000..dcf192d3 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/manual-builds.mdx @@ -0,0 +1,95 @@ +# Manual Builds + +The Wails CLI does a lot of heavy lifting for the project, but sometimes it's desirable to manually build your project. This document will discuss the different operations the CLI does and how this may be achieved in different ways. + +## Build Process + +When either `wails build` or `wails dev` are used, the Wails CLI performs a common build process: + + - Install frontend dependencies + - Build frontend project + - Generate build assets + - Compile application + - [optional] Compress application + +### Install frontend dependencies + +#### CLI Steps + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is an install command in the key `frontend:install` +- If there isn't, it skips this step +- If there is, it checks if `package.json` exists in the frontend directory. If it doesn't exist, it skips this step +- An MD5 sum is generated from the `package.json` file contents +- It checks for the existence of `package.json.md5` and if it exists, will compare the contents of it (an MD5 sum) with the one generated to see if the contents have changed. If they are the same, this step is skipped +- If `package.json.md5` does not exist, it creates it using the generated MD5 sum +- If a build is now required, or `node_modules` does not exist, or the `-f` flag is given, the install command is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm install`. + +### Build frontend project + +#### Wails CLI + +- If the `-s` flag is given, this step is skipped +- Checks `wails.json` to see if there is a build command in the key `frontend:build` +- If there isn't, it skips this step +- If there is, it is executed in the frontend directory + +#### Manual Steps + +This step could be done from the command line or a script with `npm run build` or whatever the frontend build script is. + +### Generate assets + +#### Wails CLI + +- If `-nopackage` flag is set, this stage is skipped +- If the `build/appicon.png` file does not exist, a default one is created +- For Windows, see [Bundling for Windows](#windows) +- If `build/windows/icon.ico` does not exist, it will create it from the `build/appicon.png` image. + +##### Windows + +- If `build/windows/icon.ico` does not exist, it will create it from `build/appicon.png` using icon sizes of 256, 128, 64, 48, 32 and 16. This is done using [winicon](https://github.com/leaanthony/winicon). +- If the `build/windows/.manifest` file does not exist, it creates it from a default version. +- Compiles the application as a production build (above) +- Uses [winres](https://github.com/tc-hib/winres) to bundle the icon and manifest into a `.syso` file ready for linking. + +#### Manual Steps + +- Create `icon.ico` using the [winicon](https://github.com/leaanthony/winicon) CLI tool (or any other tool). +- Create / Update a `.manifest` file for your application +- Use the [winres CLI](https://github.com/tc-hib/go-winres) to generate a `.syso` file. + +### Compile application + +#### Wails CLI + +- If the `-clean` flag is provided, the `build` directory is deleted and recreated +- For `wails dev`, the following default Go flags are used: `-tags dev -gcflags "all=-N -l"` +- For `wails build`, the following default Go flags are used: `-tags desktop,production -ldflags "-w -s"` + - On Windows, `-ldflags "-w -h -H windowsgui"` +- Additional tags passed to the CLI using `-tags` are added to the defaults +- Additional ldflags passed to the CLI using `-ldflags` are added to the defaults +- The `-o` flag is passed through +- The Go compiler specified by `-compiler` will be used for compilation + +#### Manual steps + +- For dev build, the minimum command would be: `go build -tags dev -gcflags "all=-N -l"` +- For production build, the minimum command would be: `go build -tags desktop,production -ldflags "-w -s -H windowsgui"` +- Ensure that you compile in the same directory as the `.syso` file + +### Compress application + +#### Wails CLI + +- If the `-upx` flag has been given, the `upx` program will be run to compress the application with the default settings +- If `-upxflags` is also passed, these flags are used instead of the default ones + +#### Manual steps + +- Run `upx [flags]` manually to compress the application. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/migrating.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/migrating.mdx new file mode 100644 index 00000000..72940df9 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/migrating.mdx @@ -0,0 +1,191 @@ +# Migrating from v1 + +## Обзор + +Wails v2 is a significant change from v1. This document aims to highlight the changes and the steps in migrating an existing project. + +### Creating the Application + +In v1, the main application is created using `wails.CreateApp`, bindings are added with `app.Bind`, then the application is run using `app.Run()`. + +Example: + +```go title="v1" + app := wails.CreateApp(&wails.AppConfig{ + Title: "MyApp", + Width: 1024, + Height: 768, + JS: js, + CSS: css, + Colour: "#131313", + }) + app.Bind(basic) + app.Run() +``` + +In v2, there is just a single method, `wails.Run()`, that accepts [application options](../reference/options.mdx#application-options). + +```go title="v2" + err := wails.Run(&options.App{ + Title: "MyApp", + Width: 800, + Height: 600, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + basic, + }, + }) +``` + +### Binding + +In v1, it was possible to bind both arbitrary functions and structs. In v2, this has been simplified to only binding structs. The struct instances that were previously passed to the `Bind()` method in v1, are now specified in the `Bind` field of the [application options](../reference/options.mdx#application-options): + +```go title="v1" + app := wails.CreateApp(/* options */) + app.Bind(basic) +``` + +```go title="v2" + err := wails.Run(&options.App{ + /* other options */ + Bind: []interface{}{ + basic, + }, + }) +``` + +In v1, bound methods were available to the frontend at `window.backend`. This has changed to `window.go`.`` + +### Application Lifecycle + +In v1, there were 2 special methods in a bound struct: `WailsInit()` and `WailsShutdown()`. These have been replaced with 3 lifecycle hooks as part of the [application options](../reference/options.mdx#application-options): + +- [OnStartup](../reference/options.mdx#onstartup) +- [OnShutdown](../reference/options.mdx#onshutdown) +- [OnDomReady](../reference/options.mdx#ondomready) + +Note: [OnDomReady](../reference/options.mdx#ondomready) replaces the `wails:ready` system event in v1. + +These methods can be standard functions, but a common practice is to have them part of a struct: + +```go title="v2" + basic := NewBasicApp() + err := wails.Run(&options.App{ + /* Other Options */ + OnStartup: basic.startup, + OnShutdown: basic.shutdown, + OnDomReady: basic.domready, + }) +... +type Basic struct { + ctx context.Context +} +func (b *Basic) startup(ctx context.Context) { + b.ctx = ctx +} +... +``` + +### Runtime + +The runtime in v2 is much richer than v1 with support for menus, window manipulation and better dialogs. The signature of the methods has changed slightly - please refer the the [Runtime Reference](../reference/runtime/intro.mdx). + +In v1, the [runtime](../reference/runtime/intro.mdx) was available via a struct passed to `WailsInit()`. In v2, the runtime has been moved out to its own package. Each method in the runtime takes the `context.Context` that is passed to the [OnStartup](../reference/options.mdx#onstartup) method. + +```go title="Runtime Example" +package main + +import "github.com/wailsapp/wails/v2/pkg/runtime" + +type Basic struct { + ctx context.Context +} + +// startup is called at application startup +func (a *App) startup(ctx context.Context) { + a.ctx = ctx + runtime.LogInfo(ctx, "Application Startup called!") +} + +``` + +### Assets + +The _biggest_ change in v2 is how assets are handled. + +In v1, assets were passed via 2 application options: + +- `JS` - The application's Javascript +- `CSS` - The application's CSS + +This meant that the responsibility of generating a single JS and CSS file was on the developer. This essentially required the use of complicated packers such as webpack. + +In v2, Wails makes no assumptions about your frontend assets, just like a webserver. All of your application assets are passed to the application options as an `embed.FS`. + +**This means there is no requirement to bundle your assets, encode images as Base64 or attempt the dark art of bundler configuration to use custom fonts**. + +At startup, Wails will scan the given `embed.FS` for `index.html` and use its location as the root path for all the other application assets - just like a webserver would. + +Example: An application has the following project layout. All final assets are placed in the `frontend/dist` directory: + +```shell +. +├── build/ +├── frontend/ +│ └── dist/ +│ ├── index.html +│ ├── main.js +│ ├── main.css +│ └── logo.svg +├── main.go +└── wails.json +``` + +Those assets may be used by the application by simply creating an `embed.FS`: + +```go title="Assets Example" +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + err := wails.Run(&options.App{ + /* Other Options */ + AssetServer: &assetserver.Options{ + Assets: assets, + }, + }) +} +``` + +Of course, bundlers can be used if you wish to. The only requirement is to pass the final application assets directory to Wails using an `embed.FS` in the `Assets` key of the [application options](../reference/options.mdx#application-options). + +### Project Configuration + +In v1, the project configuration was stored in the `project.json` file in the project root. In v2, the project configuration is stored in the `wails.json` file in the project root. + +The format of the file is slightly different. Here is a comparison: + +

+ +| v1 | v2 | Notes | +| ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | name | | +| description | | Removed | +| author / name | author / name | | +| author / email | author / email | | +| version | version | | +| binaryname | outputfilename | Changed | +| frontend / dir | | Removed | +| frontend / install | frontend:install | Changed | +| frontend / build | frontend:build | Changed | +| frontend / bridge | | Removed | +| frontend / serve | | Removed | +| tags | | Removed | +| | wailsjsdir | The directory to generate wailsjs modules | +| | assetdir | The directory of the compiled frontend assets for `dev` mode. This is normally inferred and could be left empty. | +| | reloaddirs | Comma separated list of additional directories to watch for changes and to trigger reloads in `dev` mode. This is only needed for some more advanced asset configurations. | + +

diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx new file mode 100644 index 00000000..1655b380 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/mouse-buttons.mdx @@ -0,0 +1,25 @@ +# Клавиши мыши + +Время выполнения кода Wails перехватывает щелчки мыши для определения необходимости изменения размера окна или перемещения окна. Был задан вопрос о том, как определить, когда произошел клик мышки, потому что `window.onclick` не сообщит о кнопках мыши. Следующий код показывает, как обнаружить клики мышкой: + +```javascript +window.addEventListener("mousedown", handleMouseButtonDown); + +function handleMouseButtonDown(event) { + if (event.button === 0) { + // left mouse button + } else if (event.button === 1) { + // middle mouse button + } else if (event.button === 2) { + // right mouse button + } else if (event.button === 3) { + // back mouse button + } else if (event.button === 4) { + // forward mouse button + } else { + // other mouse button + } +} +``` + +Источник: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx new file mode 100644 index 00000000..bae44d3e --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/obfuscated.mdx @@ -0,0 +1,39 @@ +# Обфускация кода + +Wails поддерживает обфускацию вашего приложения с помощью [grable](https://github.com/burrowers/garble). + +Чтобы обфусцировать ваше приложение, вы можете добавить флаг `obfuscate` к команде `wails build`: + +```bash +wails build -obfuscated +``` + +Для изменения настроек обфускации, вы можете использовать флаг `garbleargs`: + +```bash +wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed" +``` + +These settings may be persisted in your [project config](../reference/project-config). + +## Как это работает + +При стандартной сборке, все привязанные методы доступны в фронтенде через переменную `window.go`. При вызове этих методов происходит вызов соответствущих методов в бекенде, для этого используется имя функции. При использовании обфускации, методы привязываются по ID, а не по имени. Привязки, сгенерированные в папке `wailsjs` используют эти ID для вызова метода в бекенде. + +:::note + +Чтобы убедиться, что ваше приложение будет работать в режиме обфускации, используйте сгенерированные в папке wailsjs` привязки.

+ +

:::

+ +

Пример

+ +

Импортирование метода "Greet" из биндинга:

+ +
import { Greet } from "../../wailsjs/go/main/App";
+
+// snip
+Greet("World");
+`
+ +обеспечит корректную работу с включенным режимом обфускации, так как привязки будут сгенерированы заново, используя новый механизм вызова метода по ID. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/overscroll.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/overscroll.mdx new file mode 100644 index 00000000..915633d0 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/overscroll.mdx @@ -0,0 +1,10 @@ +# Overscroll + +[Overscroll](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) - это "эффект отскоков", который иногда получается, когда вы прокручиваете за границы содержимого страницы. Это часто используется в мобильных приложениях. Это можно отключить с помощью CSS: + +```css +html { + height: 100%; + overflow: hidden; +} +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx new file mode 100644 index 00000000..a51741b2 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/routing.mdx @@ -0,0 +1,47 @@ +# Маршрутизация + +Маршрутизация - это популярный способ переключения шаблонов в приложении. Эта страница предлагает некоторые рекомендации о том, как это сделать. + +## Vue + +Рекомендуемый подход к маршрутизации в Vue — [Hash Mode](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode): + +```js +import { createRouter, createWebHashHistory } from "vue-router"; + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + //... + ], +}); +``` + +## Angular + +Рекомендуемый подход к маршрутизации в Angular - [HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies#_hashlocationstrategy): + +```ts +RouterModule.forRoot(routes, { useHash: true }); +``` + +## React + +Рекомендуемый подход к маршрутизации в React - [HashRouter](https://reactrouter.com/docs/en/v6/routers/hash-router): + +```jsx +import { HashRouter } from "react-router-dom"; + +ReactDOM.render( + + {/* The rest of your app goes here */} + + } exact /> + } /> + } /> + {/* more... */} + + , + root +); +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/signing.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/signing.mdx new file mode 100644 index 00000000..4c7cf45b --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/signing.mdx @@ -0,0 +1,387 @@ +# Code Signing + +This is a guide on how you can sign your binaries generated with Wails on MacOS and Windows. The guide will target CI environments, more specifically GitHub Actions. + +## Windows + +First off you need a code signing certificate. If you do not already have one, Microsoft's info page lists some providers [here](https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/get-a-code-signing-certificate). Please note that an EV certificate is not required unless you need to write kernel-level software such as device drivers. For signing your Wails app, a standard code signing certificate will do just fine. + +It may be a good idea to check with your certificate provider how to sign your binaries on your local machine before targeting automated build systems, just so you know if there are any special requirements. For instance, [here](https://www.ssl.com/how-to/using-your-code-signing-certificate/) is SSL.com's code signing guide for Windows. If you know how to sign locally, it will be easier to troubleshoot any potential issues in a CI environment. For instance, SSL.com code signing certificates require the `/tr` flag for [SignTool.exe](https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool) while other providers may only need the `/t` flag for providing the timestamping server. Popular GitHub Actions for signing Windows binaries like [this one](https://github.com/Dana-Prajea/code-sign-action) does not support the `/tr` flag on SignTool.exe. Therefore this guide will focus on signing our app manually with PowerShell commands, but you can use actions like the [code-sign-action](https://github.com/Dana-Prajea/code-sign-action) Action if you prefer. + +First off, let's make sure we are able to build our Wails app in our GitHub CI. Here is a small workflow template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend manually here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +Next we need to give the GitHub workflow access to our signing certificate. This is done by encoding your .pfx or .p12 certificate into a base64 string. To do this in PowerShell, you can use the following command assuming your certificate is called 'my-cert.p12': + +```PowerShell +certutil -encode .\my-cert.p12 my-cert-base64.txt +``` + +You should now have your .txt file with the base64 encoded certificate. It should start with _-----BEGIN CERTIFICATE-----_ and end with _-----END CERTIFICATE-----_. Now you need to make two action secrets on GitHub. Navigate to _Settings -> Secrets -> Actions_ and create the two following secrets: + +- **WIN_SIGNING_CERT** with the contents of your base64 encoded certificate text. +- **WIN_SIGNING_CERT_PASSWORD** with the contents of your certificate password. + +Now we're ready to implement the signing in our workflow using one of the two methods: + +### Method 1: signing with commands + +This method uses PowerShell commands to sign our app, and leaves you control over the entire signing process. + +After the `"Build Wails app"` step, we can add the following step to our workflow: + +```yaml +- name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd /t /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' + +``` + +This script creates a new directory for your certificate file, creates the certificate file from our base64 secret, converts it to a .pfx file, and finally signs the binary. The following variables needs to be replaced in the last line: + +- **signing algorithm**: usually sha256. +- **timestamping server**: URL to the timestamping server to use with your certificate. +- **path to binary**: path to the binary you want to sign. + +Given that our Wails config has `outputfilename` set to "app.exe" and that we have a certificate from SSL.com, this would be our workflow: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\app.exe + + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +### Method 2: automatically signing with Action + +It is possible to use a Windows code signing Action like [this](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate) one, but note it requires a SHA1 hash for the certificate and a certificate name. View an example of how to configure it on the Action's [marketplace](https://github.com/marketplace/actions/code-sign-a-file-with-pfx-certificate). + +--- + +## MacOS + +First off you need your code signing certificate from Apple. If you do not have one, a simple Google search will help you acquire one. Once you have your certificate, you need to export it and encode it to base64. [This tutorial](https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions) shows you how to do that in an easy manner. Once you have exported your .p12 certificate file, you can encode it to base64 as seen in the tutorial with the following command: + +```bash +base64 Certificates.p12 | pbcopy +``` + +Now you're ready to create some GitHub project secrets, just as with Windows: + +- **APPLE_DEVELOPER_CERTIFICATE_P12_BASE64** with the contents of your newly copied base64 certificate. +- **APPLE_DEVELOPER_CERTIFICATE_PASSWORD** with the contents of your certificate password. +- **APPLE_PASSWORD** with the contents of an App-Specific password to your Apple-ID account which you can generate [here](https://appleid.apple.com/account/manage). + +Let's make sure we are able to build our Wails app in our GitHub Action workflow. Here is a small template: + +```yaml +name: "example" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +For code signing on macOS, [gon](https://github.com/mitchellh/gon) is a very handy tool for code signing and communicating with Apple servers, also written in Go, and will be used in this guide. + +After the `Build Wails app` step, add the following to the workflow: + +```yaml +- name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon +``` + +Now we need to configure some gon config files in our `build/darwin` directory: + +1. gon-sign.json: + +```json +{ + "source": ["./build/bin/app.app"], + "bundle_id": "app.myapp", + "apple_id": { + "username": "my-appleid@email.com", + "password": "@env:APPLE_PASSWORD" + }, + "sign": { + "application_identity": "Developer ID Application: My Name" + } +} +``` + +Where `source` is your Wails binary, `bundle_id` is your bundle ID, `apple_id` contains your Apple ID username and App-Specific password which you created earlier, and `sign.application_identity` is your identity which you can find by running the following command: + +```bash +security find-identity -v -p codesigning +``` + +2. entitlements.plist: + +```plist + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.network.server + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.downloads.read-write + + + +``` + +In this file you configure the entitlements you need for you app, e.g. camera permissions if your app uses the camera. Read more about entitlements [here](https://developer.apple.com/documentation/bundleresources/entitlements). + +Make sure you have updated your `Info.plist` file with the same bundle ID as you entered in `gon-sign.json`. Here's an example `Info.plist` file: + +```plist + + + CFBundlePackageTypeAPPL + CFBundleNameMyApp + CFBundleExecutableapp + CFBundleIdentifierapp.myapp + CFBundleVersion0.1.0 + CFBundleGetInfoStringMy app is cool and nice and chill and + CFBundleShortVersionString0.1.0 + CFBundleIconFileiconfile + LSMinimumSystemVersion10.13.0 + NSHighResolutionCapabletrue + LSApplicationCategoryTypepublic.app-category.utilities + NSHumanReadableCopyright© Me + +``` + +Now we're ready to add the signing step in our workflow after building the Wails app: + +```yaml +- name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} +- name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json +``` + +Please note that signing binaries with Apple could take anywhere from minutes to hours. + +## Combined workflow file: + +Here is our GitHub workflow file with Windows + macOS combined: + +```yaml +name: "example combined" +on: + workflow_dispatch: + # This Action only starts when you go to Actions and manually run the workflow. + +jobs: + package: + strategy: + matrix: + platform: [windows-latest, macos-latest] + go-version: [1.18] + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 14 + # You may need to manually build you frontend here, unless you have configured frontend build and install commands in wails.json. + - name: Get Wails + run: go install github.com/wailsapp/wails/v2/cmd/wails@latest + - name: Build Wails app + run: | + wails build + - name: MacOS download gon for code signing and app notarization + if: matrix.platform == 'macos-latest' + run: | + brew install mitchellh/gon/gon + - name: Import Code-Signing Certificates for macOS + if: matrix.platform == 'macos-latest' + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Sign our macOS binary + if: matrix.platform == 'macos-latest' + run: | + echo "Signing Package" + gon -log-level=info ./build/darwin/gon-sign.json + - name: Sign Windows binaries + if: matrix.platform == 'windows-latest' + run: | + echo "Creating certificate file" + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_SIGNING_CERT }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + echo "Signing our binaries" + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' .\build\bin\Monitor.exe + - name: upload artifacts macOS + if: matrix.platform == 'macos-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-macos + path: build/bin/* + - name: upload artifacts windows + if: matrix.platform == 'windows-latest' + uses: actions/upload-artifact@v2 + with: + name: wails-binaries-windows + path: build/bin/* +``` + +# End notes + +This guide inspired by the RiftShare project and its workflow, which is highly recommended to check out [here](https://github.com/achhabra2/riftshare/blob/main/.github/workflows/build.yaml). diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/templates.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/templates.mdx new file mode 100644 index 00000000..bdf4cdbc --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/templates.mdx @@ -0,0 +1,97 @@ +# Шаблоны + +Wails генерирует проекты из заранее созданных шаблонов. В v1 это было трудно поддерживать набор проектов, которые были подвержены устареванию. В v2 для расширения прав и возможностей сообщества добавлено несколько новых возможностей для шаблонов: + +- Возможность создания проектов из [удаленных шаблонов](../reference/cli.mdx#remote-templates) +- Инструменты, которые помогут создать собственные шаблоны + +## Создание шаблонов + +Для создания шаблона вы можете использовать команду `wails generate template`. Для создания шаблона по умолчанию запустите: + +`wails generate template -name mytemplate` + +Это создает каталог "mytemplate" с файлами по умолчанию: + +```shell title=mytemplate/ +. +|-- NEXTSTEPS.md +|-- README.md +|-- app.tmpl.go +|-- frontend +| `-- dist +| |-- assets +| | |-- fonts +| | | |-- OFL.txt +| | | `-- nunito-v16-latin-regular.woff2 +| | `-- images +| | `-- logo-dark.svg +| |-- index.html +| |-- main.css +| `-- main.js +|-- go.mod.tmpl +|-- main.tmpl.go +|-- template.json +`-- wails.tmpl.json +``` + +### Обзор шаблона + +Шаблон по умолчанию состоит из следующих файлов и директорий: + +| Имя файла / Каталог | Описание | +| ------------------- | ------------------------------------ | +| NEXTSTEPS.md | Инструкции по заполнению шаблона | +| README.md | README публикуемый с шаблоном | +| app.tmpl.go | `app.go` файл шаблона | +| frontend/ | Каталог, содержащий файлы интерфейса | +| go.mod.tmpl | `go.mod` файл шаблона | +| main.tmpl.go | `main.go` файл шаблона | +| template.json | Метаданные шаблона | +| wails.tmpl.json | `wails.json` файл шаблона | + +На данный момент желательно выполнить шаги в `NEXTSTEPS.md`. + +## Создать шаблон из существующего проекта + +Можно создать шаблон из существующего проекта фронтенда, передав путь к проекту при генерации шаблона. Теперь мы рассмотрим как создать шаблон Vue 3: + +- Установите vue cli: `npm install -g @vue/cli` +- Создайте проект по умолчанию: `vue create vue3-base` + - Выберите `Default (Vue 3) ([Vue 3] babel, eslint)` +- После создания проекта, выполните: + +```shell +> wails generate template -name wails-vue3-template -frontend .\vue3-base\ +Extracting base template files... +Migrating existing project files to frontend directory... +Updating package.json data... +Renaming package.json -> package.tmpl.json... +Updating package-lock.json data... +Renaming package-lock.json -> package-lock.tmpl.json... +``` + +- Шаблон теперь может быть настроен как указано в файле `NEXTSTEPS.md` +- Как только файлы будут готовы, их можно протестировать, запустив: `wails init -n my-vue3-project -t .\wails-vue3-template\` +- Для тестирования нового проекта выполните: `cd my-vue3-project` затем `wails build` +- Как только проект будет скомпилирован, запустите его: `.\build\bin\my-vue3-project.exe` +- У вас должно получиться полностью работающее приложение Vue3: + +```mdx-code-block +
+ +
+``` + +## Публикация шаблона + +Для публикации шаблона просто загрузите файлы на GitHub. Поощряется следующая лучшая практика: + +- Удалите любые нежелательные файлы и каталоги (например, `.git`) из вашей frontend директории +- Убедитесь, что `template.json` завершен, особенно `helpurl` +- Отправить файлы на GitHub +- Создайте PR на странице [Шаблоны сообщества](../community/templates.mdx) +- Расскажите о своем шаблоне на [Template Announcement](https://github.com/wailsapp/wails/discussions/825) форуме 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 new file mode 100644 index 00000000..7e7081fa --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/troubleshooting.mdx @@ -0,0 +1,162 @@ +# Troubleshooting + +An assortment of troubleshooting tips. + +## The `wails` command appears to be missing? + +If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt. + +## My application is displaying a white/blank screen + +Check that your application includes the assets from the correct directory. In your `main.go` file, you will have something similar to the following code: + +```go +//go:embed all:frontend/dist +var assets embed.FS +``` + +Check that `frontend/dist` contains your application assets. + +### Mac + +If this happens on Mac, try adding the following to your `Info.plist`: + +```xml +NSAppTransportSecurity + + NSAllowsLocalNetworking + + +``` + +Reference: https://github.com/wailsapp/wails/issues/1504#issuecomment-1174317433 + +## Mac application not valid + +If your built application looks like this in finder: + +```mdx-code-block +

+ +

+``` + +it's likely that your application's `info.plist` is invalid. Update the file in `build/.app/Contents/info.plist` and check if the data is valid, EG check the binary name is correct. To persist the changes, copy the file back to the `build/darwin` directory. + +## Cannot call backend method from frontend with variadic arguments + +If you have a backend method defined with variadic parameters, eg: + +```go +func (a *App) TestFunc(msg string, args ...interface{}) error { + // Code +} +``` + +calling this method from the frontend like this will fail: + +```js +var msg = "Hello: "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, ...args) + .then((result) => { + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Workaround: + +```js +var msg = "Hello "; +var args = ["Go", "JS"]; +window.go.main.App.TestFunc(msg, args) + .then((result) => { + //without the 3 dots + //do things here + }) + .catch((error) => { + //handle error + }); +``` + +Credit: https://github.com/wailsapp/wails/issues/1186 + +## I'm having getting proxy errors when trying to install Wails + +If you are getting errors like this: + +``` +"https://proxy.golang.org/github.com/wailsapp/wails/cmd/wails/@v/list": dial tcp 172.217.163.49:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. +``` + +it's probably because the official Go Proxy is being blocked (Users in China have reported this). The solution is to set up the proxy manually, eg: + +``` +go env -w GO111MODULE=on +go env -w GOPROXY=https://goproxy.cn,direct +``` + +Source: https://github.com/wailsapp/wails/issues/1233 + +## The generated Typescript doesn't have the correct types + +Sometimes the generated Typescript doesn't have the correct types. To mitigate this, it is possible to specify what types should be generated using the `ts_type` struct tag. For more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types). + +## When I navigate away from `index.html`, I am unable to call methods on the frontend + +If you navigate away from `index.html` to a new html file, the context will be lost. This can be fixed by adding the following imports to the `` section of any new page you navigate to: + +```html + + + + +``` + +Source: https://github.com/wailsapp/wails/discussions/1512 + +## I get `too many open files` errors on my Mac when I run `wails dev` + +By default, macOS will only allow you to open a maximum of 256 files. This can affect the `wails dev` command. This limit can be increased by running: `ulimit -n 1024` in the terminal. + +FSNotify is [looking to move to Apple's fsevents](https://github.com/fsnotify/fsnotify/issues/11) for Mac. If this isn't completed soon, we will create our own implementation, tracked [here](https://github.com/wailsapp/wails/issues/1733). + +## My Mac app gives me weird compilation errors + +A few users have reported seeing compilation errors such as the following: + +```shell +# github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin +In file included from ../../pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-beta.44.2/internal/frontend/desktop/darwin/callbacks.go:9: +In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12: +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString +- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); + ~~~~~~~~~~~~~~ ^ ~ +/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT' + #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A))) +``` + +This is _normally_ due to a mismatch with the OS version you are running and the version of the XCode Command Line Tools installed. If you see an error like this, try upgrading your XCode Command Line Tools to the latest version. + +If reinstalling Xcode Command Tools still fails, you can check the path where the toolkit is located using: + +`xcode-select -p` + +If `/Applications/Xcode.app/Contents/Developer` is displayed, run `sudo xcode-select --switch /Library/Developer/CommandLineTools` + +Sources: https://github.com/wailsapp/wails/issues/1806 and https://github.com/wailsapp/wails/issues/1140#issuecomment-1290446496 + +-- + +## Cannot start service: Host version "x.x.x does not match binary version "x.x.x" + +It's preferable to add `frontend/node_modules` and `frontend/package-lock.json` to your `.gitignore`. Otherwise when opening your repository on another machine that may have different versions of Node installed, you may not be able to run your application. + +If this does happen, simply delete `frontend/node_modules` and `frontend/package-lock.json` and run your `wails build` or `wails dev` command again. \ No newline at end of file diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/vscode.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/vscode.mdx new file mode 100644 index 00000000..539c52ba --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/vscode.mdx @@ -0,0 +1,82 @@ + +# Visual Studio Code + +Эта страница предназначена для разных советов и трюков при использовании Visual Studio Code с Wails. + +## Конфигурация Vetur + +Большое спасибо [@Lyimmi](https://github.com/Lyimmi) за этот совет. Изначально оставил сообщение [здесь](https://github.com/wailsapp/wails/issues/1791#issuecomment-1228158349). + +Vetur - это популярный плагин для кода Visual Studio, который предоставляет подсветку синтаксиса и завершение кода для Vue проектов. При загрузке проекта Wails в VSCode, Ветур выбросит ошибку, ожидая найти проект фронтенда в корневом каталоге. Чтобы исправить это, можно сделать следующее: + +Создайте файл `vetur.config.js` в корне проекта. + +```javascript +// vetur.config.js +/** @type {import('vls').VeturConfig} */ +module.exports = { + // **optional** default: `{}` + // override vscode settings + // Notice: It only affects the settings used by Vetur. + settings: { + "vetur.useWorkspaceDependencies": true, + "vetur.experimental.templateInterpolationService": true + }, + // **optional** default: `[{ root: './' }]` + // support monorepos + projects: [ + { + // **required** + // Where is your project? + // It is relative to `vetur.config.js`. + // root: './packages/repo1', + root: './frontend', + // **optional** default: `'package.json'` + // Where is `package.json` in the project? + // We use it to determine the version of vue. + // It is relative to root property. + package: './package.json', + // **optional** + // Where is TypeScript config file in the project? + // It is relative to root property. + tsconfig: './tsconfig.json', + // **optional** default: `'./.vscode/vetur/snippets'` + // Where is vetur custom snippets folders? + snippetFolder: './.vscode/vetur/snippets', + // **optional** default: `[]` + // Register globally Vue component glob. + // If you set it, you can get completion by that components. + // It is relative to root property. + // Notice: It won't actually do it. You need to use `require.context` or `Vue.component` + globalComponents: [ + './src/components/**/*.vue' + ] + } + ] +} +``` + +Затем настройте `frontend/tsconfig.json`: + +```javascript +{ + "compilerOptions": { + "module": "system", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "outFile": "../../built/local/tsc.js", + "allowJs": true + }, + "exclude": [ + "node_modules", + "**/*.spec.ts" + ], + "include": [ + "src/**/*", + "wailsjs/**/*.ts" + ] +} +``` +Это должно позволить теперь использовать Vetur как ожидалось. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx new file mode 100644 index 00000000..b332c5f1 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx @@ -0,0 +1,58 @@ +# NSIS installer + +```mdx-code-block +

+ +
+

+``` + +Wails supports generating Windows installers using the [NSIS installer](https://nsis.sourceforge.io/). + +## Installing NSIS + +### Windows + +The installer is available on the [NSIS Download](https://nsis.sourceforge.io/Download) page. + +If you use the chocolatey package manager, run the following script: + +``` +choco install nsis +``` + +If you install NSIS manually, you need to add the _Bin_ folder, which contains `makensis.exe`, in your NSIS installation to your path. [Here](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) is a good tutorial on how to add to path on Windows. + +### Linux + +Пакет `nsis` должен быть доступен через менеджер пакетов вашего дистрибутива. + +### MacOS + +NSIS is available to install through homebrew: `brew install nsis`. + +## Generating the installer + +When a new project is created, Wails generates the NSIS configuration files in `build/windows/installer`. The config data is read from `installer/info.json` and that is configured to use the project's `wails.json` Info section: + +```json +// ... + "Info": { + "companyName": "My Company Name", + "productName": "Wails Vite", + "productVersion": "1.0.0", + "copyright": "Copyright.........", + "comments": "Built using Wails (https://wails.io)" + }, +``` + +To generate an installer for your application, use the `-nsis` flag with `wails build`: + +``` +wails build -nsis +``` + +The installer will now be available in the `build/bin` directory. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows.mdx new file mode 100644 index 00000000..821808c0 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/guides/windows.mdx @@ -0,0 +1,61 @@ +# Windows + +This page has miscellaneous guides related to developing Wails applications for Windows. + +## Handling the WebView2 Runtime Dependency + +Wails applications built for Windows have a runtime requirement on the Microsoft [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/). Windows 11 will have this installed by default, but some machines won't. Wails offers an easy approach to dealing with this dependency. + +By using the `-webview2` flag when building, you can decide what your application will do when a suitable runtime is not detected (including if the installed runtime is too old). The four options are: + +1. Download +2. Embed +3. Browser +4. Error + +### Download + +This option will prompt the user that no suitable runtime has been found and then offer to download and run the official bootstrapper from Microsoft's WebView2 site. If the user proceeds, the official bootstrapper will be downloaded and run. + +### Embed + +This option embeds the official bootstrapper within the application. If no suitable runtime has been found, the application will offer to run the bootstrapper. This adds ~150k to the binary size. + +### Browser + +This option will prompt the user that no suitable runtime has been found and then offer to open a browser to the official WebView2 page where the bootstrapper can be downloaded and installed. The application will then exit, leaving the installation up to the user. + +### Error + +If no suitable runtime is found, an error is given to the user and no further action taken. + +## Fixed version runtime + +Another way of dealing with webview2 dependency is shipping it yourself. You can download [fixed version runtime](https://developer.microsoft.com/microsoft-edge/webview2/#download-section) and bundle or download it with your application. + +Also, you should specify path to fixed version of webview2 runtime in the `windows.Options` structure when launching wails. + +```go + wails.Run(&options.App{ + Windows: &windows.Options{ + WebviewBrowserPath: "", + }, + }) +``` + +Note: When `WebviewBrowserPath` is specified, `error` strategy will be forced in case of minimal required version mismatch or invalid path to a runtime. + +## Spawning other programs + +When spawning other programs, such as scripts, you will see the window appear on the screen. To hide the window, you can use the following code: + +```go +cmd := exec.Command("your_script.exe") +cmd.SysProcAttr = &syscall.SysProcAttr{ + HideWindow: true, + CreationFlags: 0x08000000, +} +cmd.Start() +``` + +Solution provided by [sithembiso](https://github.com/sithembiso) on the [discussions board](https://github.com/wailsapp/wails/discussions/1734#discussioncomment-3386172). diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/howdoesitwork.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/howdoesitwork.mdx new file mode 100644 index 00000000..e678188e --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/howdoesitwork.mdx @@ -0,0 +1,369 @@ +--- +sidebar_position: 20 +--- + +# How does it work? + +A Wails application is a standard Go application, with a webkit frontend. The Go part of the application consists of the application code and a runtime library that provides a number of useful operations, like controlling the application window. The frontend is a webkit window that will display the frontend assets. Also available to the frontend is a Javascript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as Javascript methods that can be called, just as if they were local Javascript methods. + +```mdx-code-block +
+ +
+``` + +## The Main Application + +### Обзор + +The main application consists of a single call to `wails.Run()`. It accepts the application configuration which describes the size of the application window, the window title, what assets to use, etc. A basic application might look like this: + +```go title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (b *App) startup(ctx context.Context) { + b.ctx = ctx +} + +func (b *App) shutdown(ctx context.Context) {} + +func (b *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +### Options rundown + +This example has the following options set: + +- `Title` - The text that should appear in the window's title bar +- `Width` & `Height` - The dimensions of the window +- `Assets` - The application's frontend assets +- `OnStartup` - A callback for when the window is created and is about to start loading the frontend assets +- `OnShutdown` - A callback for when the application is about to quit +- `Bind` - A slice of struct instances that we wish to expose to the frontend + +A full list of application options can be found in the [Options Reference](reference/options). + +#### Assets + +The `Assets` option is mandatory as you can't have a Wails application without frontend assets. Those assets can be any files you would expect to find in a web application - html, js, css, svg, png, etc. **There is no requirement to generate asset bundles** - plain files will do. When the application starts, it will attempt to load `index.html` from your assets and the frontend will essentially work as a browser from that point on. It is worth noting that there is no requirement on where in the `embed.FS` the files live. It is likely that the embed path uses a nested directory relative to your main application code, such as `frontend/dist`: + +```go title="main.go" +//go:embed all:frontend/dist +var assets embed.FS +``` + +At startup, Wails will iterate the embedded files looking for the directory containing `index.html`. All other assets will be loaded relative to this directory. + +As production binaries use the files contained in `embed.FS`, there are no external files required to be shipped with the application. + +When running in development mode using the `wails dev` command, the assets are loaded off disk, and any changes result in a "live reload". The location of the assets will be inferred from the `embed.FS`. + +More details can be found in the [Application Development Guide](guides/application-development.mdx). + +#### Application Lifecycle Callbacks + +Just before the frontend is about to load `index.html`, a callback is made to the function provided in [OnStartup](reference/options.mdx#onstartup). A standard Go context is passed to this method. This context is required when calling the runtime so a standard pattern is to save a reference to in this method. Just before the application shuts down, the [OnShutdown](reference/options.mdx#onshutdown) callback is called in the same way, again with the context. There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in Javascript. It is also possible to hook into the window close (or application quit) event by setting the option [OnBeforeClose](reference/options.mdx#onbeforeclose). + +#### Method Binding + +The `Bind` option is one of the most important options in a Wails application. It specifies which struct methods to expose to the frontend. Think of structs like "controllers" in a traditional web application. When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate Javascript versions of those methods that can be called by the frontend code. + +:::info Note + +Wails requires that you pass in an _instance_ of the struct for it to bind it correctly + +::: + +In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`: + +```go {16,24} title="main.go" +package main + +import ( + "embed" + "log" + + "github.com/wailsapp/wails/v2" + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" +) + +//go:embed all:frontend/dist +var assets embed.FS + +func main() { + + app := &App{} + + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} + + +type App struct { + ctx context.Context +} + +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s!", name) +} +``` + +You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`: + +```go {8-10} + //... + err := wails.Run(&options.App{ + Title: "Basic Demo", + Width: 1024, + Height: 768, + AssetServer: &assetserver.Options{ + Assets: assets, + }, + Bind: []interface{}{ + app, + &mystruct1{}, + &mystruct2{}, + }, + }) + +``` + +When you run `wails dev` (or `wails generate module`), a frontend module will be generated containing the following: + +- Javascript bindings for all bound methods +- Typescript declarations for all bound methods +- Typescript definitions for all Go structs used as inputs or outputs by the bound methods + +This makes it incredibly simple to call Go code from the frontend, using the same strongly typed datastructures. + +## The Frontend + +### Обзор + +The frontend is a collection of files rendered by webkit. It's like a browser and webserver in one. There is virtually[^1] no limit to which frameworks or libraries you can use. The main points of interaction between the frontend and your Go code are: + +- Calling bound Go methods +- Calling runtime methods + +### Calling bound Go methods + +When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). The generated files mirror the package names in your application. In the example above, we bind `app`, which has one public method `Greet`. This will lead to the generation of the following files: + +```bash +wailsjs + └─go + └─main + ├─App.d.ts + └─App.js +``` + +Here we can see that there is a `main` package that contains the Javascript bindings for the bound `App` struct, as well as the Typescript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular Javascript function: + +```javascript +// ... +import { Greet } from "../wailsjs/go/main/App"; + +function doGreeting(name) { + Greet(name).then((result) => { + // Do something with result + }); +} +``` + +The Typescript declaration file gives you the correct types for the bound methods: + +```ts +export function Greet(arg1: string): Promise; +``` + +The generated methods return a Promise. A successful call will result in the first return value from the Go call to be passed to the `resolve` handler. An unsuccessful call is when a Go method that has an error type as it's second return value, passes an error instance back to the caller. This is passed back via the `reject` handler. In the example above, `Greet` only returns a `string` so the Javascript call will never reject - unless invalid data is passed to it. + +All data types are correctly translated between Go and Javascript. Even structs. If you return a struct from a Go call, it will be returned to your frontend as a Javascript class. + +:::info Note + +Struct fields *must* have a valid `json` tag to be included in the generated Typescript. + +Anonymous nested structs are not supported at this time. + +::: + +It is possible to send structs back to Go. Any Javascript map/class passed as an argument that is expecting a struct, will be converted to that struct type. To make this process a lot easier, in `dev` mode, a TypeScript module is generated, defining all the struct types used in bound methods. Using this module, it's possible to construct and send native Javascript objects to the Go code. + +There is also support for Go methods that use structs in their signature. All Go structs specified by a bound method (either as parameters or return types) will have Typescript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and Javascript. + +Example: We update our `Greet` method to accept a `Person` instead of a string: + +```go title="main.go" +type Person struct { + Name string `json:"name"` + Age uint8 `json:"age"` + Address *Address `json:"address"` +} + +type Address struct { + Street string `json:"street"` + Postcode string `json:"postcode"` +} + +func (a *App) Greet(p Person) string { + return fmt.Sprintf("Hello %s (Age: %d)!", p.Name, p.Age) +} +``` + +The `wailsjs/go/main/App.js` file will still have the following code: + +```js title="App.js" +export function Greet(arg1) { + return window["go"]["main"]["App"]["Greet"](arg1); +} +``` + +But the `wailsjs/go/main/App.d.ts` file will be updated with the following code: + +```ts title="App.d.ts" +import { main } from "../models"; + +export function Greet(arg1: main.Person): Promise; +``` + +As we can see, the "main" namespace is imported from a new "models.ts" file. This file contains all the struct definitions used by our bound methods. In this example, this is a `Person` struct. If we look at `models.ts`, we can see how the models are defined: + +```ts title="models.ts" +export namespace main { + export class Address { + street: string; + postcode: string; + + static createFrom(source: any = {}) { + return new Address(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.street = source["street"]; + this.postcode = source["postcode"]; + } + } + export class Person { + name: string; + age: number; + address?: Address; + + static createFrom(source: any = {}) { + return new Person(source); + } + + constructor(source: any = {}) { + if ("string" === typeof source) source = JSON.parse(source); + this.name = source["name"]; + this.age = source["age"]; + this.address = this.convertValues(source["address"], Address); + } + + convertValues(a: any, classs: any, asMap: boolean = false): any { + if (!a) { + return a; + } + if (a.slice) { + return (a as any[]).map((elem) => this.convertValues(elem, classs)); + } else if ("object" === typeof a) { + if (asMap) { + for (const key of Object.keys(a)) { + a[key] = new classs(a[key]); + } + return a; + } + return new classs(a); + } + return a; + } + } +} +``` + +So long as you have TypeScript as part of your frontend build configuration, you can use these models in the following way: + +```js title="mycode.js" +import { Greet } from "../wailsjs/go/main/App"; +import { main } from "../wailsjs/go/models"; + +function generate() { + let person = new main.Person(); + person.name = "Peter"; + person.age = 27; + Greet(person).then((result) => { + console.log(result); + }); +} +``` + +The combination of generated bindings and TypeScript models makes for a powerful development environment. + +More information on Binding can be found in the [Binding Methods](guides/application-development.mdx#binding-methods) section of the [Application Development Guide](guides/application-development.mdx). + +### Calling runtime methods + +The Javascript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations: + +```js title="mycode.js" +window.runtime.EventsEmit("my-event", 1); +``` + +More details about the JS runtime can be found in the [Runtime Reference](reference/runtime/intro). + +[^1]: There is a very small subset of libraries that use features unsupported in WebViews. There are often alternatives and workarounds for such cases. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/introduction.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/introduction.mdx new file mode 100644 index 00000000..28e124ce --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/introduction.mdx @@ -0,0 +1,75 @@ +--- +sidebar_position: 1 +--- + +# Введение + +Wails - это проект, позволяющий писать настольные приложения с использованием Go и web технологий. + +Считайте, что это легкая и быстрая альтернатива Electron для Go. Вы можете легко создавать приложения с гибкостью и мощностью Go, в сочетании с богатым современным фронтендом. + +### Возможности + +- Нативные меню, диалоги, темы и прозрачность +- Поддержка Windows, macOS и linux +- Встроенные шаблоны для Svelte, React, Preact, Vue, Lit и Vanilla JS +- Легко вызывать методы Go из Javascript +- Автоматическая генерация структур Go в Typescript модели +- Для Windows не требуется CGO или внешние DLL +- Горячая перезагрузка, используя мощь [Vite](https://vitejs.dev/) +- Мощный CLI для простого создания, сборки и упаковки приложений +- Богатая [runtime библиотека](/docs/reference/runtime/intro) +- Приложения, созданные с помощью Wails совместимы с Apple и Microsoft Store + +Например, [varly](https://varly.app) - настольное приложение для MacOS и Windows, написанное с помощью Wails. Оно не только великолепно выглядит, но и использует системные меню и полупрозрачность - все, что можно ожидать от современного нативного приложения. + +```mdx-code-block +

+ + + +

+``` + +### Шаблоны для быстрого начала + +Wails поставляется с рядом предварительно настроенных шаблонов, которые позволяют вам быстро создать и запустить ваше приложение. Есть шаблоны для следующих фреймворков: Svelte, React, Vue, Preact, Lit и Vanilla. Для каждого шаблона есть и Javascript и Typescript версия. + +### Системные элементы + +Wails использует специально созданную библиотеку для обработки системных элементов, таких как окна, меню, диалоги и так далее, чтобы вы могли создавать хорошо выглядящие, богатые функционалом приложения. + +**В нем нет встроенного браузера**, таким образом, это экономично с точки зрения ресурсов. Вместо этого он использует нативный движок отрисовки для необходимой платформы. На Windows это новая библиотека Microsoft Webview2, основанная на Chromium. + +### Взаимодействие Go & Javascript + +Wails автоматически делает ваши методы на Go доступными в Javascript, чтобы вы могли вызывать их по имени! Он также генерирует Typescript версии структур, используемых вашими методами на Go, чтобы вы могли передавать те же данные между Go и Javascript. + +### Библиотека среды выполнения + +Wails предоставляет runtime библиотеку для Go и Javascript, которая справляется со многими вещами, нужными для современных приложений, например, работа с событиями, логирование, диалоги и так далее. + +### Опыт разработки в реальном времени + +#### Автоматическая пересборка + +Когда вы запускаете ваше приложение в режиме разработки, Wails будет собирать его, но читать ресурсы с диска. Он будет отслеживать любые изменения в вашем коде на Go и автоматически пересобирать и перезапускать приложение. + +#### Автоматическая перезагрузка + +Когда будут обнаружены изменения ресурсов вашего приложения, ваше запущенное приложение перезагрузится, почти сразу, отражая ваши изменения. + +#### Разрабатывайте приложение в браузере + +Если вы предпочитаете отладку и разработку в браузере, то Wails это умеет. Запущенное приложение также имеет веб-сервер, который запустит ваше приложение в любом, подключенном к нему, браузере. Он будет перезапускаться когда ресурсы на вашем диске изменятся. + +### Бинарные файлы, готовые к выпуску + +Когда вы готовы сделать финальную сборку вашего приложения, CLI соберет всё в один исполняемый файл со всеми ресурсами внутри. На Windows и MacOS есть возможность создать нативный установочный пакет для распространения. Ресурсы, используемые при упаковке (иконка, info.plist, файл manifest'а, и т.д.) являются частью вашего проекта и могут быть изменены, что даёт вам полный контроль над тем, как вы создаете приложение. + +### Инструментарий + +Wails CLI предоставляет легкий способ генерировать, собирать и упаковывать ваши приложения. Оно создаст иконки, соберет ваше приложение с оптимальными параметрами и создаст готовый для распространения исполняемый файл. Выберите из нескольких стартовых шаблонов для быстрого старта! 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 new file mode 100644 index 00000000..f9a64773 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx @@ -0,0 +1,229 @@ +--- +sidebar_position: 2 +--- + +# CLI + +The Wails CLI has a number of commands that are used for managing your projects. All commands are run in the following way: + +`wails ` + +## init + +`wails init` is used for generating projects. + +| Flag | Description | Default | +|:------------------ |:----------------------------------------------------------------------------------------------------------------------- |:-------------------:| +| -n "project name" | Name of the project. **Mandatory**. | | +| -d "project dir" | Project directory to create | Name of the project | +| -g | Initialise git repository | | +| -l | List available project templates | | +| -q | Suppress output to console | | +| -t "template name" | The project template to use. This can be the name of a default template or a URL to a remote template hosted on github. | vanilla | +| -ide | Generate IDE project files | | +| -f | Force build application | false | + +Example: `wails init -n test -d mytestproject -g -ide vscode -q` + +This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently. + +More information on using IDEs with Wails can be found [here](../guides/ides.mdx). + +### Remote Templates + +Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL. + +Example: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]` + +A list of community maintained templates can be found [here](../community/templates.mdx) + +::warning Внимание + +**Проект Wails не поддерживает и не несет ответственности за сторонние шаблоны!** + +Если вы не уверены в шаблоне, проверьте `package.json` и `wails.json` на какие скрипты запускаются и какие пакеты установлены. + +::: + +## build + +`wails build` is used for compiling your project to a production-ready binary. + +| Flag | Description | Default | +|:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- | +| -platform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platforms) eg. `windows/arm64`. Note, if you do not give the architecture, `runtime.GOARCH` is used. | platform = `GOOS` environment variable if given else `runtime.GOOS`.
arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. | +| -clean | Cleans the `build/bin` directory | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -nopackage | Do not package application | | +| -o filename | Output filename | | +| -s | Skip building the frontend | false | +| -f | Force build application | false | +| -tags "extra tags" | Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated | | +| -upx | Compress final binary using "upx" | | +| -upxflags | Flags to pass to upx | | +| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 | +| -webview2 | WebView2 installer strategy: download,embed,browser,error | download | +| -u | Updates your project's `go.mod` to use the same version of Wails as the CLI | | +| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | false | +| -trimpath | Remove all file system paths from the resulting executable. | false | +| -race | Build with Go's race detector | false | +| -windowsconsole | Keep the console window for Windows builds | | +| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false | +| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` | + +For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide. + +If you prefer to build using standard Go tooling, please consult the [Manual Builds](../guides/manual-builds.mdx) guide. + +Example: + +`wails build -clean -o myproject.exe` + +:::Info +On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`. +::: + +:::info UPX on Apple Silicon + +There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon. + +::: + +:::info UPX on Windows + +Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437). + +::: + +### Platforms + +Supported platforms are: + +| Platform | Description | +|:---------------- |:--------------------------------------------- | +| darwin | MacOS + architecture of build machine | +| darwin/amd64 | MacOS 10.13+ AMD64 | +| darwin/arm64 | MacOS 11.0+ ARM64 | +| darwin/universal | MacOS AMD64+ARM64 universal application | +| windows | Windows 10/11 + architecture of build machine | +| windows/amd64 | Windows 10/11 AMD64 | +| windows/arm64 | Windows 10/11 ARM64 | +| linux | Linux + architecture of build machine | +| linux/amd64 | Linux AMD64 | +| linux/arm64 | Linux ARM64 | + +## doctor + +`wails doctor` will run diagnostics to ensure that your system is ready for development. + +Example: + +``` +Wails CLI v2.0.0-beta + +Scanning system - Please wait (this may take a long time)...Done. + +System +------ +OS: Windows 10 Pro +Version: 2009 (Build: 19043) +ID: 21H1 +Go Version: go1.18 +Platform: windows +Architecture: amd64 + +Dependency Package Name Status Version +---------- ------------ ------ ------- +WebView2 N/A Installed 93.0.961.52 +npm N/A Installed 6.14.15 +*upx N/A Installed upx 3.96 + +* - Optional Dependency + +Diagnosis +--------- +Your system is ready for Wails development! + +``` + +## dev + +`wails dev` is used to run your application in a "live development" mode. This means: + +- The application's `go.mod` will be updated to use the same version of Wails as the CLI +- The application is compiled and run automatically +- A watcher is started and will trigger a rebuild of your dev app if it detects changes to your go files +- A webserver is started on `http://localhost:34115` which serves your application (not just frontend) over http. This allows you to use your favourite browser development extensions +- All application assets are loaded from disk. If they are changed, the application will automatically reload (not rebuild). All connected browsers will also reload +- 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. + +| Flag | Description | Default | +|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- | +| -assetdir "./path/to/assets" | Serve assets from the given directory instead of using the provided asset FS | Value in `wails.json` | +| -browser | Opens a browser to `http://localhost:34115` on startup | | +| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go | +| -e | Extensions to trigger rebuilds (comma separated) | go | +| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` | +| -ldflags "flags" | Additional ldflags to pass to the compiler | | +| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | | +| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | Debug | +| -noreload | Disable automatic reload when assets change | | +| -nocolour | Turn off colour cli output | false | +| -nogen | Disable generate module | | +| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 | +| -wailsjsdir | The directory to generate the generated Wails JS modules | Value in `wails.json` | +| -debounce | The time to wait for reload after an asset change is detected | 100 (milliseconds) | +| -devserver "host:port" | The address to bind the wails dev server to | "localhost:34115" | +| -frontenddevserverurl "url" | Use 3rd party dev server url to serve assets, EG Vite | "" | +| -appargs "args" | Arguments passed to the application in shell style | | +| -save | Saves the given `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` flags in `wails.json` to become the defaults for subsequent invocations. | | +| -race | Build with Go's race detector | false | +| -s | Skip building the frontend | false | + +Example: + +`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser` + +This command will do the following: + +- Build the application and run it (more details [here](../guides/manual-builds.mdx) +- Generate the Wails JS modules in `./frontend/src` +- Watch for updates to files in `./frontend/dist` and reload on any change +- Open a browser and connect to the application + +There is more information on using this feature with existing framework scripts [here](../guides/application-development.mdx#live-reloading). + +## generate + +### template + +Wails uses templates for project generation. The `wails generate template` command helps scaffold a template so that it may be used for generating projects. + +| Flag | Description | +|:---------------- |:------------------------------------------- | +| -name | The template name (Mandatory) | +| -frontend "path" | Path to frontend project to use in template | + +For more details on creating templates, consult the [Templates guide](../guides/templates.mdx). + +### module + +The `wails generate module` command allows you to manually generate the `wailsjs` directory for your application. + +## update + +`wails update` will update the version of the Wails CLI. + +| Flag | Description | +|:------------------ |:------------------------------------- | +| -pre | Update to latest pre-release version | +| -version "version" | Install a specific version of the CLI | + +## version + +`wails version` will simply output the current CLI version. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx new file mode 100644 index 00000000..304f57d6 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/menus.mdx @@ -0,0 +1,227 @@ +--- +sidebar_position: 4 +--- + +# Menus + +It is possible to add an application menu to Wails projects. This is achieved by defining a [Menu](#menu) struct and setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu). + +An example of how to create a menu: + +```go + AppMenu := menu.NewMenu() + FileMenu := AppMenu.AddSubmenu("File") + FileMenu.AddText("&Open", keys.CmdOrCtrl("o"), openFile) + FileMenu.AddSeparator() + FileMenu.AddText("Quit", keys.CmdOrCtrl("q"), func(_ *menu.CallbackData) { + runtime.Quit() + }) + + if runtime.GOOS == "darwin" { + AppMenu.Append(menu.EditMenu()) // on macos platform, we should append EditMenu to enable Cmd+C,Cmd+V,Cmd+Z... shortcut + } + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + Menu: AppMenu, + Bind: []interface{}{ + app, + }, + ) + // ... +``` + +It is also possible to dynamically update the menu, by updating the menu struct and calling [MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu). + +The example above uses helper methods, however it's possible to build the menu structs manually. + +## Menu + +A Menu is a collection of MenuItems: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Menu struct { + Items []*MenuItem +} +``` + +For the Application menu, each MenuItem represents a single menu such as "Edit". + +A simple helper method is provided for building menus: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func NewMenuFromItems(first *MenuItem, rest ...*MenuItem) *Menu +``` + +This makes the layout of the code more like that of a menu without the need to add the menu items manually after creating them. Alternatively, you can just create the menu items and add them to the menu manually. + +## MenuItem + +A MenuItem represents an item within a Menu. + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +// MenuItem represents a menu item contained in a menu +type MenuItem struct { + Label string + Role Role + Accelerator *keys.Accelerator + Type Type + Disabled bool + Hidden bool + Checked bool + SubMenu *Menu + Click Callback +} +``` + +| Field | Type | Notes | +| ----------- | ------------------------------------ | ------------------------------------------------------------- | +| Label | string | The menu text | +| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item | +| Type | [Type](#type) | Type of MenuItem | +| Disabled | bool | Disables the menu item | +| Hidden | bool | Hides this menu item | +| Checked | bool | Adds check to item (Checkbox & Radio types) | +| SubMenu | [\*Menu](#menu) | Sets the submenu | +| Click | [Callback](#callback) | Callback function when menu clicked | +| Role | string | Defines a [role](#role) for this menu item. Mac only for now. | + +### Accelerator + +Accelerators (sometimes called keyboard shortcuts) define a binding between a keystroke and a menu item. Wails defines an Accelerator as a combination or key + [Modifier](#modifier). They are available in the `"github.com/wailsapp/wails/v2/pkg/menu/keys"` package. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut := keys.CmdOrCtrl("o") +``` + +Keys are any single character on a keyboard with the exception of `+`, which is defined as `plus`. Some keys cannot be represented as characters so there are a set of named characters that may be used: + +| | | | | +|:-----------:|:-----:|:-----:|:---------:| +| `backspace` | `f1` | `f16` | `f31` | +| `tab` | `f2` | `f17` | `f32` | +| `return` | `f3` | `f18` | `f33` | +| `enter` | `f4` | `f19` | `f34` | +| `escape` | `f5` | `f20` | `f35` | +| `left` | `f6` | `f21` | `numlock` | +| `right` | `f7` | `f22` | | +| `up` | `f8` | `f23` | | +| `down` | `f9` | `f24` | | +| `space` | `f10` | `f25` | | +| `delete` | `f11` | `f36` | | +| `home` | `f12` | `f37` | | +| `end` | `f13` | `f38` | | +| `page up` | `f14` | `f39` | | +| `page down` | `f15` | `f30` | | + +Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files. + +Example: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines cmd+o on Mac and ctrl-o on Window/Linux + myShortcut, err := keys.Parse("Ctrl+Option+A") +``` + +#### Modifier + +The following modifiers are keys that may be used in combination with the accelerator key: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +const ( + // CmdOrCtrlKey represents Command on Mac and Control on other platforms + CmdOrCtrlKey Modifier = "cmdorctrl" + // OptionOrAltKey represents Option on Mac and Alt on other platforms + OptionOrAltKey Modifier = "optionoralt" + // ShiftKey represents the shift key on all systems + ShiftKey Modifier = "shift" + // ControlKey represents the control key on all systems + ControlKey Modifier = "ctrl" +) +``` + +A number of helper methods are available to create Accelerators using modifiers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" +func CmdOrCtrl(key string) *Accelerator +func OptionOrAlt(key string) *Accelerator +func Shift(key string) *Accelerator +func Control(key string) *Accelerator +``` + +Modifiers can be combined using `keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys" + // Defines "Ctrl+Option+A" on Mac and "Ctrl+Alt+A" on Window/Linux + myShortcut := keys.Combo("a", ControlKey, OptionOrAltKey) +``` + +### Type + +Each menu item must have a type and there are 5 types available: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +const ( + TextType Type = "Text" + SeparatorType Type = "Separator" + SubmenuType Type = "Submenu" + CheckboxType Type = "Checkbox" + RadioType Type = "Radio" +) +``` + +For convenience, helper methods are provided to quickly create a menu item: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func Text(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func Separator() *MenuItem +func Radio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func Checkbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func SubMenu(label string, menu *Menu) *Menu +``` + +You can also create menu items directly on a menu by using the "Add" helpers: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +func (m *Menu) AddText(label string, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSeparator() *MenuItem +func (m *Menu) AddRadio(label string, selected bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddCheckbox(label string, checked bool, accelerator *keys.Accelerator, click Callback) *MenuItem +func (m *Menu) AddSubMenu(label string, menu *Menu) *MenuI +``` + +A note on radio groups: A radio group is defined as a number of radio menu items that are next to each other in the menu. This means that you do not need to group items together as it is automatic. However, that also means you cannot have 2 radio groups next to each other - there must be a non-radio item between them. + +### Callback + +Each menu item may have a callback that is executed when the item is clicked: + +```go title="Package: github.com/wailsapp/wails/v2/pkg/menu" +type Callback func(*CallbackData) + +type CallbackData struct { + MenuItem *MenuItem +} +``` + +The function is given a `CallbackData` struct which indicates which menu item triggered the callback. This is useful when using radio groups that may share a callback. + +### Role + +:::info Roles + +Roles are currently supported on Mac only. + +::: + +A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles: + +| Role | Description | +| ------------ | ------------------------------------------------------------------------ | +| AppMenuRole | The standard Mac application menu. Can be created using `menu.AppMenu()` | +| EditMenuRole | The standard Mac edit menu. Can be created using `menu.EditMenu()` | 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 new file mode 100644 index 00000000..389ed81f --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/options.mdx @@ -0,0 +1,736 @@ +--- +sidebar_position: 3 +--- + +# Options + +## Application Options + +The `Options.App` struct contains the application configuration. It is passed to the `wails.Run()` method: + +```go title="Example" +import ( + "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/assetserver" + "github.com/wailsapp/wails/v2/pkg/options/linux" + "github.com/wailsapp/wails/v2/pkg/options/mac" + "github.com/wailsapp/wails/v2/pkg/options/windows" +) + +func main() { + + err := wails.Run(&options.App{ + Title: "Menus Demo", + Width: 800, + Height: 600, + DisableResize: false, + Fullscreen: false, + WindowStartState: options.Maximised, + Frameless: true, + MinWidth: 400, + MinHeight: 400, + MaxWidth: 1280, + MaxHeight: 1024, + StartHidden: false, + HideWindowOnClose: false, + BackgroundColour: &options.RGBA{R: 0, G: 0, B: 0, A: 255}, + AlwaysOnTop: false, + AssetServer: &assetserver.Options{ + Assets: assets, + Handler: assetsHandler, + Middleware: assetsMidldeware, + }, + Menu: app.applicationMenu(), + Logger: nil, + LogLevel: logger.DEBUG, + LogLevelProduction: logger.ERROR, + OnStartup: app.startup, + OnDomReady: app.domready, + OnShutdown: app.shutdown, + OnBeforeClose: app.beforeClose, + CSSDragProperty: "--wails-draggable", + CSSDragValue: "drag", + ZoomFactor: 1.0, + IsZoomControlEnabled: false, + Bind: []interface{}{ + app, + }, + Windows: &windows.Options{ + WebviewIsTransparent: false, + WindowIsTranslucent: false, + BackdropType: windows.Mica, + DisableWindowIcon: false, + DisableFramelessWindowDecorations: false, + WebviewUserDataPath: "", + WebviewBrowserPath: "", + Theme: windows.SystemDefault, + CustomTheme: &windows.ThemeSettings{ + DarkModeTitleBar: windows.RGB(20, 20, 20), + DarkModeTitleText: windows.RGB(200, 200, 200), + DarkModeBorder: windows.RGB(20, 0, 20), + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + }, + // User messages that can be customised + Messages *windows.Messages + // OnSuspend is called when Windows enters low power mode + OnSuspend func() + // OnResume is called when Windows resumes from low power mode + OnResume func() + }, + Mac: &mac.Options{ + TitleBar: &mac.TitleBar{ + TitlebarAppearsTransparent: true, + HideTitle: false, + HideTitleBar: false, + FullSizeContent: false, + UseToolbar: false, + HideToolbarSeparator: true, + }, + Appearance: mac.NSAppearanceNameDarkAqua, + WebviewIsTransparent: true, + WindowIsTranslucent: false, + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + Linux: &linux.Options{ + Icon: icon, + WindowIsTranslucent: false, + }, + Debug: options.Debug{ + OpenInspectorOnStartup: false, + }, + }) + + if err != nil { + log.Fatal(err) + } +} + +``` + +### Title + +The text shown in the window's title bar. + +Name: Title
Type: `string` + +### Width + +The initial width of the window. + +Name: Width
Type: `int`
Default: 1024. + +### Height + +The initial height of the window. + +Name: Height
Type: `int`
Default: 768 + +### DisableResize + +By default, the main window is resizable. Setting this to `true` will keep it a fixed size. + +Name: DisableResize
Type: `bool` + +### Fullscreen + +Deprecated: Please use [WindowStartState](#windowstartstate). + +### WindowStartState + +Defines how the window should present itself at startup. + +| Value | Win | Mac | Lin | +| ---------- | --- | --- | --- | +| Fullscreen | ✅ | ✅ | ✅ | +| Maximised | ✅ | ✅ | ✅ | +| Minimised | ✅ | ❌ | ✅ | + +Name: WindowStartState
Type: `options.WindowStartState` + +### Frameless + +When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx). + +Name: Frameless
Type: `bool` + +### MinWidth + +This sets the minimum width for the window. If the value given in `Width` is less than this value, the window will be set to `MinWidth` by default. + +Name: MinWidth
Type: `int` + +### MinHeight + +This sets the minimum height for the window. If the value given in `Height` is less than this value, the window will be set to `MinHeight` by default. + +Name: MinHeight
Type: `int` + +### MaxWidth + +This sets the maximum width for the window. If the value given in `Width` is more than this value, the window will be set to `MaxWidth` by default. + +Name: MaxWidth
Type: `int` + +### MaxHeight + +This sets the maximum height for the window. If the value given in `Height` is more than this value, the window will be set to `MaxHeight` by default. + +Name: MaxHeight
Type: `int` + +### StartHidden + +When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called. + +Name: StartHidden
Type: `bool` + +### HideWindowOnClose + +By default, closing the window will close the application. Setting this to `true` means closing the window will + +hide the window instead. + +Name: HideWindowOnClose
Type: `bool` + +### BackgroundColour + +This value is the default background colour of the window. Example: options.NewRGBA(255,0,0,128) - Red at 50% transparency + +Name: BackgroundColour
Type: `*options.RGBA`
Default: white + +### AlwaysOnTop + +Indicates that the window should stay above other windows when losing focus. + +Name: AlwaysOnTop
Type: `bool` + +### Assets + +Deprecated: Please use Assets on [AssetServer specific options](#assetserver). + +### AssetsHandler + +Deprecated: Please use AssetsHandler on [AssetServer specific options](#assetserver). + +### AssetServer + +This defines AssetServer specific options. It allows to customize the AssetServer with static assets, serving assets dynamically with an `http.Handler` or hook into the request chain with an `assetserver.Middleware`. + +Not all features of an `http.Request` are currently supported, please see the following feature matrix: + +| Feature | Win | Mac | Lin | +| ----------------------- | --- | --- | --- | +| GET | ✅ | ✅ | ✅ | +| POST | ✅ | ✅ | ❌ | +| PUT | ✅ | ✅ | ❌ | +| PATCH | ✅ | ✅ | ❌ | +| DELETE | ✅ | ✅ | ❌ | +| Request Headers | ✅ | ✅ | ❌ | +| Request Body | ✅ | ✅ | ❌ | +| Request Body Streaming | ❌ | ❌ | ❌ | +| Response StatusCodes | ✅ | ✅ | ❌ | +| Response Headers | ✅ | ✅ | ❌ | +| Response Body | ✅ | ✅ | ✅ | +| Response Body Streaming | ❌ | ❌ | ✅ | +| WebSockets | ❌ | ❌ | ❌ | + +NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support. + +Name: AssetServer
Type: `*assetserver.Options` + +#### Assets + +The static frontend assets to be used by the application. + +A GET request is first tried to be served from this `fs.FS`. If the `fs.FS` returns `os.ErrNotExist` for that file, the request handling will fallback to the [Handler](#handler) and tries to serve the GET request from it. + +If set to nil, all GET requests will be forwarded to [Handler](#handler). + +Name: Assets
Type: `fs.FS` + +#### Handler + +The assets handler is a generic `http.Handler` for fallback handling of assets that can't be found. + +The handler will be called for every GET request that can't be served from [Assets](#assets), due to `os.ErrNotExist`. Furthermore all non GET requests will always be served from this Handler. If not defined, the result is the following in cases where the Handler would have been called: + +- GET request: `http.StatusNotFound` +- Other request: `http.StatusMethodNotAllowed` + +NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html on every path, that does not contain a file extension. + +Name: AssetsHandler
Type: `http.Handler` + +#### Middleware + +Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default request handler dynamically, e.g. implement specialized Routing etc. The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default handler used by the AssetServer as an argument. + +If not defined, the default AssetServer request chain is executed. + +Name: Middleware
Type: `assetserver.Middleware` + +### Menu + +The menu to be used by the application. More details about Menus in the [Menu Reference](../reference/runtime/menu.mdx). + +:::note + +On Mac, if no menu is specified, a default menu will be created. + +::: + +Name: Menu
Type: `*menu.Menu` + +### Logger + +The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: Logger
Type: `logger.Logger`
Default: Logs to Stdout + +### LogLevel + +The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevel
Type: `logger.LogLevel`
Default: `Info` in dev mode, `Error` in production mode + +### LogLevelProduction + +The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx). + +Name: LogLevelProduction
Type: `logger.LogLevel`
Default: `Error` + +### OnStartup + +This callback is called after the frontend has been created, but before `index.html` has been loaded. It is given the application context. + +Name: OnStartup
Type: `func(ctx context.Context)` + +### OnDomReady + +This callback is called after the frontend has loaded `index.html` and its resources. It is given the application context. + +Name: OnDomReady
Type: `func(ctx context.Context)` + +### OnShutdown + +This callback is called after the frontend has been destroyed, just before the application terminates. It is given the application context. + +Name: OnShutdown
Type: `func(ctx context.Context)` + +### OnBeforeClose + +If this callback is set, it will be called when the application is about to quit, either by clicking the window close button or calling `runtime.Quit`. Returning true will cause the application to continue, false will continue shutdown as normal. This is good for confirming with the user that they wish to exit the program. + +Example: + +```go title=windowsapp.go +func (b *App) beforeClose(ctx context.Context) (prevent bool) { + dialog, err := runtime.MessageDialog(ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Quit?", + Message: "Are you sure you want to quit?", + }) + + if err != nil { + return false + } + return dialog != "Yes" +} +``` + +Name: OnBeforeClose
Type: `func(ctx context.Context) bool` + +### CSSDragProperty + +Indicates the CSS property to use to identify which elements can be used to drag the window. Default: `--wails-draggable`. + +Name: CSSDragProperty
Type: `string` + +### CSSDragValue + +Indicates what value the `CSSDragProperty` style should have to drag the window. Default: `drag`. + +Name: CSSDragValue
Type: `string` + +### ZoomFactor + +Name: ZoomFactor
Type: `float64` + +This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out. + +### IsZoomControlEnabled + +Name: IsZoomControlEnabled
Type: `bool` + +This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar). + +### Bind + +A slice of struct instances defining methods that need to be bound to the frontend. + +Name: Bind
Type: `[]interface{}` + +### Windows + +This defines [Windows specific options](#windows). + +Name: Windows
Type: `*windows.Options` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent). + +For Windows 11 versions before build 22621, this will use the [BlurBehind](https://learn.microsoft.com/en-us/windows/win32/dwm/blur-ovw) method for translucency, which can be slow. For Windows 11 versions after build 22621, this will enable the newer translucency types that are much faster. By default, the type of translucency used will be determined by Windows. To configure this, use the [BackdropType](#BackdropType) option. + +Name: WindowIsTranslucent
Type: `bool` + +#### BackdropType + +:::note + +Requires Windows 11 build 22621 or later. + +::: + +Sets the translucency type of the window. This is only applicable if [WindowIsTranslucent](#WindowIsTranslucent) is set to `true`. + +Name: BackdropType
Type `windows.BackdropType` + +The value can be one of the following: + +| Value | Description | +| ------- | ----------------------------------------------------------------------------------------- | +| Auto | Let Windows decide which backdrop to use | +| None | Do not use translucency | +| Acrylic | Use [Acrylic](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic) effect | +| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect | +| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. | + +#### DisableWindowIcon + +Setting this to `true` will remove the icon in the top left corner of the title bar. + +Name: DisableWindowIcon
Type: `bool` + +#### DisableFramelessWindowDecorations + +Setting this to `true` will remove the window decorations in [Frameless](#Frameless) mode. This means there will be no 'Aero Shadow' and no 'Rounded Corners' shown for the window. Please note that 'Rounded Corners' are only supported on Windows 11. + +Name: DisableFramelessWindowDecorations
Type: `bool` + +#### WebviewUserDataPath + +This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used. + +Name: WebviewUserDataPath
Type: `string` + +#### WebviewBrowserPath + +This defines the path to a directory with WebView2 executable files and libraries. If empty, webview2 installed in the system will be used. + +Important information about distribution of fixed version runtime: + +- [How to get and extract runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode) +- [Known issues for fixed version](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version) +- [The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\.](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions) + +Name: WebviewBrowserPath
Type: `string` + +#### Theme + +Minimum Windows Version: Windows 10 2004/20H1 + +This defines the theme that the application should use: + +| Value | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| SystemDefault | _Default_. The theme will be based on the system default. If the user changes their theme, the application will update to use the new setting | +| Dark | The application will use a dark theme exclusively | +| Light | The application will use a light theme exclusively | + +Name: Theme
Type: `windows.Theme` + +#### CustomTheme + +:::note + +Minimum Windows Version: Windows 10/11 2009/21H2 Build 22000 + +::: + +Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive. + +Name: CustomTheme
Type: `windows.CustomTheme` + +##### CustomTheme type + +The CustomTheme struct uses `int32` to specify the colour values. These are in the standard(!) Windows format of: `0x00BBGGAA`. A helper function is provided to do RGB conversions into this format: `windows.RGB(r,g,b uint8)`. + +NOTE: Any value not provided will default to black. + +```go +type ThemeSettings struct { + DarkModeTitleBar int32 + DarkModeTitleBarInactive int32 + DarkModeTitleText int32 + DarkModeTitleTextInactive int32 + DarkModeBorder int32 + DarkModeBorderInactive int32 + LightModeTitleBar int32 + LightModeTitleBarInactive int32 + LightModeTitleText int32 + LightModeTitleTextInactive int32 + LightModeBorder int32 + LightModeBorderInactive int32 +} +``` + +Example: + +```go + CustomTheme: &windows.ThemeSettings{ + // Theme to use when window is active + DarkModeTitleBar: windows.RGB(255, 0, 0), // Red + DarkModeTitleText: windows.RGB(0, 255, 0), // Green + DarkModeBorder: windows.RGB(0, 0, 255), // Blue + LightModeTitleBar: windows.RGB(200, 200, 200), + LightModeTitleText: windows.RGB(20, 20, 20), + LightModeBorder: windows.RGB(200, 200, 200), + // Theme to use when window is inactive + DarkModeTitleBarInactive: windows.RGB(128, 0, 0), + DarkModeTitleTextInactive: windows.RGB(0, 128, 0), + DarkModeBorderInactive: windows.RGB(0, 0, 128), + LightModeTitleBarInactive: windows.RGB(100, 100, 100), + LightModeTitleTextInactive: windows.RGB(10, 10, 10), + LightModeBorderInactive: windows.RGB(100, 100, 100), + }, +``` + +#### Messages + +A struct of strings used by the webview2 installer if a valid webview2 runtime is not found. + +Name: Messages
Type: `*windows.Messages` + +Customise this for any language you choose to support. + +#### ResizeDebounceMS + +ResizeDebounceMS is the amount of time to debounce redraws of webview2 when resizing the window. The default value (0) will perform redraws as fast as it can. + +Name: ResizeDebounceMS
Type: `uint16` + +#### OnSuspend + +If set, this function will be called when Windows initiates a switch to low power mode (suspend/hibernate) + +Name: OnSuspend
Type: `func()` + +#### OnResume + +If set, this function will be called when Windows resumes from low power mode (suspend/hibernate) + +Name: OnResume
Type: `func()` + +### Mac + +This defines [Mac specific options](#mac). + +Name: Mac
Type: `*mac.Options` + +#### TitleBar + +The TitleBar struct provides the ability to configure the look and feel of the title bar. + +Name: TitleBar
Type: [`*mac.TitleBar`](#titlebar-struct) + +##### Titlebar struct + +The titlebar of the application can be customised by using the TitleBar options: + +```go +type TitleBar struct { + TitlebarAppearsTransparent bool + HideTitle bool + HideTitleBar bool + FullSizeContent bool + UseToolbar bool + HideToolbarSeparator bool +} +``` + +| Name | Description | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| TitlebarAppearsTransparent | Makes the titlebar transparent. This has the effect of hiding the titlebar and the content fill the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc) | +| HideTitle | Hides the title of the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc) | +| HideTitleBar | Removes [NSWindowStyleMaskTitled](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktitled/) from the style mask | +| FullSizeContent | Makes the webview fill the entire window. [Apple Docs](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemaskfullsizecontentview) | +| UseToolbar | Adds a default toolbar to the window. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar?language=objc) | +| HideToolbarSeparator | Removes the line beneath the toolbar. [Apple Docs](https://developer.apple.com/documentation/appkit/nstoolbar/1516954-showsbaselineseparator?language=objc) | + +Preconfigured titlebar settings are available: + +| Setting | Пример | +| --------------------------- | ---------------------------------------------- | +| `mac.TitleBarDefault()` | ![](/img/reference/titlebar-default.webp) | +| `mac.TitleBarHidden()` | ![](/img/reference/titlebar-hidden.webp) | +| `mac.TitleBarHiddenInset()` | ![](/img/reference/titlebar-hidden-inset.webp) | + +Example: + +```go +Mac: &mac.Options{ + TitleBar: mac.TitleBarHiddenInset(), +} +``` + +Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on customising the titlebar. + +#### Appearance + +Appearance is used to set the style of your app in accordance with Apple's [NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc) names. + +Name: Appearance
Type: [`mac.AppearanceType`](#appearance-type) + +##### Appearance type + +You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc). + +| Value | Description | +| ----------------------------------------------------- | --------------------------------------------------------------- | +| DefaultAppearance | DefaultAppearance uses the default system value | +| NSAppearanceNameAqua | The standard light system appearance | +| NSAppearanceNameDarkAqua | The standard dark system appearance | +| NSAppearanceNameVibrantLight | The light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastAqua | A high-contrast version of the standard light system appearance | +| NSAppearanceNameAccessibilityHighContrastDarkAqua | A high-contrast version of the standard dark system appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantLight | A high-contrast version of the light vibrant appearance | +| NSAppearanceNameAccessibilityHighContrastVibrantDark | A high-contrast version of the dark vibrant appearance | + +Example: + +```go +Mac: &mac.Options{ + Appearance: mac.NSAppearanceNameDarkAqua, +} +``` + +#### WebviewIsTransparent + +Setting this to `true` will make the webview background transparent when an alpha value of `0` is used. This means that if you use `rgba(0,0,0,0)` for `background-color` in your CSS, the host window will show through. Often combined with [WindowIsTranslucent](#WindowIsTranslucent) to make frosty-looking applications. + +Name: WebviewIsTransparent
Type: `bool` + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications. + +Name: WindowIsTranslucent
Type: `bool` + +#### About + +This configuration lets you set the title, message and icon for the "About" menu item in the app menu created by the "AppMenu" role. + +Name: About
Type: [`*mac.AboutInfo`](#about-struct) + +##### About struct + +```go + +type AboutInfo struct { + Title string + Message string + Icon []byte +} +``` + +If these settings are provided, an "About" menu item will appear in the app menu (when using the `AppMenu` role). Given this configuration: + +```go +//go:embed build/appicon.png +var icon []byte + +func main() { + err := wails.Run(&options.App{ + ... + Mac: &mac.Options{ + About: &mac.AboutInfo{ + Title: "My Application", + Message: "© 2021 Me", + Icon: icon, + }, + }, + }) +``` + +The "About" menu item will appear in the app menu: + +```mdx-code-block +
+ +
+
+``` + +When clicked, that will open an about message box: + +```mdx-code-block +
+ +
+
+``` + +### Linux + +This defines [Linux specific options](#linux). + +Name: Linux
Type: `*linux.Options` + +#### Icon + +Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified). + +Name: Icon
Type: `[]byte` + +Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. + +NOTE: Gnome on Wayland at least does not display this icon. To have a application icon there, a `.desktop` file has to be used. On KDE it should work. + +The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality. + +#### WindowIsTranslucent + +Setting this to `true` will make the window background translucent. Some window managers may ignore it, or result in a black window. + +Name: WindowIsTranslucent
Type: `bool` + +### Debug + +This defines [Debug specific options](#Debug) that apply to debug builds. + +Name: Debug
Type: `options.Debug` + +#### OpenInspectorOnStartup + +Setting this to `true` will open the WebInspector on startup of the application. + +Name: OpenInspectorOnStartup
Type: `bool` 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 new file mode 100644 index 00000000..b63e1921 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/project-config.mdx @@ -0,0 +1,57 @@ +--- +sidebar_position: 5 +--- + +# Настройка проекта + +Конфигурация проекта находится в файле `wails.json` в каталоге проекта. Структура конфигурации: + +```json +{ + "name": "[The project name]", + "assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]", + "reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]", + "build:dir": "[The directory where the build files reside. Defaults to 'build']", + "frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']", + "frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]", + "frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]", + "frontend:dev": "[This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build]", + "frontend:dev:build": "[This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev]", + "frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]", + "frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]", + "frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output]", + "wailsjsdir": "[Relative path to the directory that the auto-generated JS modules will be created]", + "version": "[Project config version]", + "outputfilename": "[The name of the binary]", + "debounceMS": 100, // The default time the dev server waits to reload when it detects a change in assets + "devServer": "[Address to bind the wails dev sever to. Default: localhost:34115]", + "appargs": "[Arguments passed to the application in shell style when in dev mode]", + "runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS. + "preBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]" + }, + "postBuildHooks": { + "GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]", + "GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]", + "*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]" + }, + "info": { // Data used to populate manifests and version info. + "companyName": "[The company name. Default: [The project name]]", + "productName": "[The product name. Default: [The project name]]", + "productVersion": "[The version of the product. Default: '1.0.0']", + "copyright": "[The copyright of the product. Default: 'Copyright.........']", + "comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']" + }, + "nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple']", + "obfuscated": "[Whether the app should be obfuscated. Default: false]", + "garbleargs": "[The arguments to pass to the garble command when using the obfuscated flag]" +} +``` + +Этот файл читается CLI Wails при запуске `wails build` или `wails dev`. + +`assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` и `frontenddevserverurl` флаги в `wails build/dev` обновит конфигурацию проекта и тем самым станет по умолчанию для последующих запусков. + +Схема JSON для этого файла расположена [здесь](https://wails.io/schemas/config.v2.json). diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx new file mode 100644 index 00000000..f45c13c4 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/browser.mdx @@ -0,0 +1,13 @@ +--- +sidebar_position: 7 +--- + +# Браузер + +Эти методы относятся к системному браузеру. + +### BrowserOpenURL + +Открывает данный URL-адрес в системном браузере. + +Go: `BrowserOpenURL(ctx context.Context, url string)`
JS: `BrowserOpenURL(url string)` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx new file mode 100644 index 00000000..cf7bf37b --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/dialog.mdx @@ -0,0 +1,302 @@ +--- +sidebar_position: 5 +--- + +# Dialog + +This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes. + +:::info Javascript + +Dialog is currently unsupported in the JS runtime. + +::: + +### OpenDirectoryDialog + +Opens a dialog that prompts the user to select a directory. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected directory (blank if the user cancelled) or an error + +### OpenFileDialog + +Opens a dialog that prompts the user to select a file. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error)` + +Returns: Selected file (blank if the user cancelled) or an error + +### OpenMultipleFilesDialog + +Opens a dialog that prompts the user to select multiple files. Can be customised using [OpenDialogOptions](#opendialogoptions). + +Go: `OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error)` + +Returns: Selected files (nil if the user cancelled) or an error + +### SaveFileDialog + +Opens a dialog that prompts the user to select a filename for the purposes of saving. Can be customised using [SaveDialogOptions](#savedialogoptions). + +Go: `SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error)` + +Returns: The selected file (blank if the user cancelled) or an error + +### MessageDialog + +Displays a message using a message dialog. Can be customised using [MessageDialogOptions](#messagedialogoptions). + +Go: `MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error)` + +Returns: The text of the selected button or an error + +## Options + +### OpenDialogOptions + +```go +type OpenDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + ResolvesAliases bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| ResolvesAliases | If true, returns the file not the alias | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### SaveDialogOptions + +```go +type SaveDialogOptions struct { + DefaultDirectory string + DefaultFilename string + Title string + Filters []FileFilter + ShowHiddenFiles bool + CanCreateDirectories bool + TreatPackagesAsDirectories bool +} +``` + +| Field | Description | Win | Mac | Lin | +| -------------------------- | ---------------------------------------------- | --- | --- | --- | +| DefaultDirectory | The directory the dialog will show when opened | ✅ | ✅ | ✅ | +| DefaultFilename | The default filename | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| [Filters](#filefilter) | A list of file filters | ✅ | ✅ | ✅ | +| ShowHiddenFiles | Show files hidden by the system | | ✅ | ✅ | +| CanCreateDirectories | Allow user to create directories | | ✅ | | +| TreatPackagesAsDirectories | Allow navigating into packages | | ✅ | | + +### MessageDialogOptions + +```go +type MessageDialogOptions struct { + Type DialogType + Title string + Message string + Buttons []string + DefaultButton string + CancelButton string +} +``` + +| Field | Description | Win | Mac | Lin | +| ------------- | -------------------------------------------------------------------------- | -------------- | --- | --- | +| Type | The type of message dialog, eg question, info... | ✅ | ✅ | ✅ | +| Title | Title for the dialog | ✅ | ✅ | ✅ | +| Message | The message to show the user | ✅ | ✅ | ✅ | +| Buttons | A list of button titles | | ✅ | | +| DefaultButton | The button with this text should be treated as default. Bound to `return`. | ✅[*](#windows) | ✅ | | +| CancelButton | The button with this text should be treated as cancel. Bound to `escape` | | ✅ | | + +#### Windows + +Windows has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Abort", "Retry", "Ignore", "Yes", "No", "Try Again" or "Continue". + +For Question dialogs, the default button is "Yes" and the cancel button is "No". This can be changed by setting the `DefaultButton` value to `"No"`. + +Example: +```go + result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{ + Type: runtime.QuestionDialog, + Title: "Question", + Message: "Do you want to continue?", + DefaultButton: "No", + }) +``` + +#### Linux + +Linux has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Yes", "No" + +#### Mac + +A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button is considered default and is bound to the `return` key. + +For the following code: + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, +}) +``` + +the first button is shown as default: + +```mdx-code-block +
+ +
+
+``` + +And if we specify `DefaultButton` to be "two": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", +}) +``` + +the second button is shown as default. When `return` is pressed, the value "two" is returned. + +```mdx-code-block +
+ +
+
+``` + +If we now specify `CancelButton` to be "three": + +```go +selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{ + Title: "It's your turn!", + Message: "Select a number", + Buttons: []string{"one", "two", "three", "four"}, + DefaultButton: "two", + CancelButton: "three", +}) +``` + +the button with "three" is shown at the bottom of the dialog. When `escape` is pressed, the value "three" is returned: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### DialogType + +```go +const ( + InfoDialog DialogType = "info" + WarningDialog DialogType = "warning" + ErrorDialog DialogType = "error" + QuestionDialog DialogType = "question" + ) +``` + +### FileFilter + +```go +type FileFilter struct { + DisplayName string // Filter information EG: "Image Files (*.jpg, *.png)" + Pattern string // semi-colon separated list of extensions, EG: "*.jpg;*.png" +} +``` + +#### Windows + +Windows allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Linux + +Linux allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog: + +```mdx-code-block +
+ +
+
+
+
+``` + +#### Mac + +Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided, Wails will use all the Patterns defined. + +Example: + +```go + selection, err := runtime.OpenFileDialog(b.ctx, runtime.OpenDialogOptions{ + Title: "Select File", + Filters: []runtime.FileFilter{ + { + DisplayName: "Images (*.png;*.jpg)", + Pattern: "*.png;*.jpg", + }, { + DisplayName: "Videos (*.mov;*.mp4)", + Pattern: "*.mov;*.mp4", + }, + }, + }) +``` + +This will result in the Open File dialog using `*.png,*.jpg,*.mov,*.mp4` as a filter. diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx new file mode 100644 index 00000000..373a65d7 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/events.mdx @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# Events + +The Wails runtime provides a unified events system, where events can be emitted or received by either Go or Javascript. Optionally, data may be passed with the events. Listeners will receive the data in the local data types. + +### EventsOn + +This method sets up a listener for the given event name. When an event of type `eventName` is [emitted](#EventsEmit), the callback is triggered. Any additional data sent with the emitted event will be passed to the callback. It returns a function to cancel the listener. + +Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOff + +This method unregisters the listener for the given event name, optionally multiple listeneres can be unregistered via `additionalEventNames`. + +Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...string)`
JS: `EventsOff(eventName string, ...additionalEventNames)` + +### EventsOnce + +This method sets up a listener for the given event name, but will only trigger once. It returns a function to cancel the listener. + +Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`
JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void` + +### EventsOnMultiple + +This method sets up a listener for the given event name, but will only trigger a maximum of `counter` times. It returns a function to cancel the listener. + +Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`
JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void` + +### EventsEmit + +This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners. + +Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`
JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx new file mode 100644 index 00000000..2b7c764b --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/intro.mdx @@ -0,0 +1,84 @@ +--- +sidebar_position: 1 +--- + +# Введение + +The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime and the aim is to try and keep them at parity where possible. + +It has utility methods for: + +- [Window](window.mdx) +- [Menu](menu.mdx) +- [Dialog](dialog.mdx) +- [Events](events.mdx) +- [Browser](browser.mdx) +- [Log](log.mdx) + +The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package take a context as the first parameter. This context should be obtained from the [OnStartup](../options.mdx#onstartup) or [OnDomReady](../options.mdx#ondomready) hooks. + +:::info Note + +Whilst the context will be provided to the [OnStartup](../options.mdx#onstartup) method, there's no guarantee the runtime will work in this method as the window is initialising in a different thread. If you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ondomready). + +::: + +The Javascript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev` mode that provides Typescript declarations for the runtime. This should be located in the `wailsjs` directory in your frontend directory. + +### Hide + +Go: `Hide(ctx context.Context)`
JS: `Hide()` + +Hides the application. + +:::info Note + +On Mac, this will hide the application in the same way as the `Hide` menu item in standard Mac applications. This is different to hiding the window, but the application still being in the foreground. For Windows and Linux, this is currently the same as `WindowHide`. + +::: + +### Show + +Shows the application. + +:::info Note + +On Mac, this will bring the application back into the foreground. For Windows and Linux, this is currently the same as `WindowShow`. + +::: + +Go: `Show(ctx context.Context)`
JS: `Show()` + +### Quit + +Quits the application. + +Go: `Quit(ctx context.Context)`
JS: `Quit()` + +### Environment + +Returns details of the current environment. + +Go: `Environment(ctx context.Context) EnvironmentInfo`
JS: `Environment(): Promise` + +#### EnvironmentInfo + +Go: + +```go +type EnvironmentInfo struct { + BuildType string + Platform string + Arch string +} +``` + +JS: + +```ts +interface EnvironmentInfo { + buildType: string; + platform: string; + arch: string; +} +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx new file mode 100644 index 00000000..e5e6ea7a --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/log.mdx @@ -0,0 +1,130 @@ +--- +sidebar_position: 3 +--- + +# Log + +The Wails runtime provides a logging mechanism that may be called from Go or Javascript. Like most loggers, there are a number of log levels: + +- Trace +- Debug +- Info +- Warning +- Error +- Fatal + +The logger will output any log message at the current, or higher, log level. Example: The `Debug` log level will output all messages except `Trace` messages. + +### LogPrint + +Logs the given message as a raw message. + +Go: `LogPrint(ctx context.Context, message string)`
JS: `LogPrint(message: string)` + +### LogPrintf + +Logs the given message as a raw message. + +Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`
+ +### LogTrace + +Logs the given message at the `Trace` log level. + +Go: `LogTrace(ctx context.Context, message string)`
JS: `LogTrace(message: string)` + +### LogTracef + +Logs the given message at the `Trace` log level. + +Go: `LogTracef(ctx context.Context, format string, args ...interface{})`
+ +### LogDebug + +Logs the given message at the `Debug` log level. + +Go: `LogDebug(ctx context.Context, message string)`
JS: `LogDebug(message: string)` + +### LogDebugf + +Logs the given message at the `Debug` log level. + +Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`
+ +### LogInfo + +Logs the given message at the `Info` log level. + +Go: `LogInfo(ctx context.Context, message string)`
JS: `LogInfo(message: string)` + +### LogInfof + +Logs the given message at the `Info` log level. + +Go: `LogInfof(ctx context.Context, format string, args ...interface{})`
+ +### LogWarning + +Logs the given message at the `Warning` log level. + +Go: `LogWarning(ctx context.Context, message string)`
JS: `LogWarning(message: string)` + +### LogWarningf + +Logs the given message at the `Warning` log level. + +Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`
+ +### LogError + +Logs the given message at the `Error` log level. + +Go: `LogError(ctx context.Context, message string)`
JS: `LogError(message: string)` + +### LogErrorf + +Logs the given message at the `Error` log level. + +Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`
+ +### LogFatal + +Logs the given message at the `Fatal` log level. + +Go: `LogFatal(ctx context.Context, message string)`
JS: `LogFatal(message: string)` + +### LogFatalf + +Logs the given message at the `Fatal` log level. + +Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`
+ +### LogSetLogLevel + +Sets the log level. In Javascript, the number relates to the following log levels: + +| Value | Log Level | +| ----- | --------- | +| 1 | Trace | +| 2 | Debug | +| 3 | Info | +| 4 | Warning | +| 5 | Error | + +Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`
JS: `LogSetLogLevel(level: number)` + +## Using a Custom Logger + +A custom logger may be used by providing it using the [Logger](../options.mdx#logger) application option. The only requirement is that the logger implements the `logger.Logger` interface defined in `github.com/wailsapp/wails/v2/pkg/logger`: + +```go title="logger.go" +type Logger interface { + Print(message string) + Trace(message string) + Debug(message string) + Info(message string) + Warning(message string) + Error(message string) + Fatal(message string) +} +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx new file mode 100644 index 00000000..fa310817 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/menu.mdx @@ -0,0 +1,25 @@ +--- +sidebar_position: 6 +--- + +# Меню + +Эти методы относятся к меню приложения. + +:::info Javascript + +В настоящее время меню не поддерживается в JS. + +::: + +### MenuSetApplicationMenu + +Задает меню приложения для данного [меню](../menus.mdx). + +Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)` + +### MenuUpdateApplicationMenu + +Обновляет меню приложения, поднимая все изменения в меню, переданное `MenuSetationMenu`. + +Go: `MenuUpdateApplicationMenu(ctx context.Context)` 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 new file mode 100644 index 00000000..9eeee137 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/reference/runtime/window.mdx @@ -0,0 +1,221 @@ +--- +sidebar_position: 4 +--- + +# Window + +These methods give control of the application window. + +### WindowSetTitle + +Sets the text in the window title bar. + +Go: `WindowSetTitle(ctx context.Context, title string)`
JS: `WindowSetTitle(title: string)` + +### WindowFullscreen + +Makes the window full screen. + +Go: `WindowFullscreen(ctx context.Context)`
JS: `WindowFullscreen()` + +### WindowUnfullscreen + +Restores the previous window dimensions and position prior to full screen. + +Go: `WindowUnfullscreen(ctx context.Context)`
JS: `WindowUnfullscreen()` + +### WindowIsFullscreen + +Returns true if the window is full screen. + +Go: `WindowIsFullscreen(ctx context.Context) bool`
JS: `WindowIsFullscreen() bool` + +### WindowCenter + +Centers the window on the monitor the window is currently on. + +Go: `WindowCenter(ctx context.Context)`
JS: `WindowCenter()` + +### WindowExecJS + +Executes arbitrary JS code in the window. + +This method runs the code in the browser asynchronously and returns immediately. If the script causes any errors, they will only be available in the browser console. + +Go: `WindowExecJS(ctx context.Context, js string)` + +### WindowReload + +Performs a "reload" (Reloads current page). + +Go: `WindowReload(ctx context.Context)`
JS: `WindowReload()` + +### WindowReloadApp + +Reloads the application frontend. + +Go: `WindowReloadApp(ctx context.Context)`
JS: `WindowReloadApp()` + +### WindowSetSystemDefaultTheme + +Windows only. + +Go: `WindowSetSystemDefaultTheme(ctx context.Context)`
JS: `WindowSetSystemDefaultTheme()` + +Sets window theme to system default (dark/light). + +### WindowSetLightTheme + +Windows only. + +Go: `WindowSetLightTheme(ctx context.Context)`
JS: `WindowSetLightTheme()` + +Sets window theme to light. + +### WindowSetDarkTheme + +Windows only. + +Go: `WindowSetDarkTheme(ctx context.Context)`
JS: `WindowSetDarkTheme()` + +Sets window theme to dark. + +### WindowShow + +Shows the window, if it is currently hidden. + +Go: `WindowShow(ctx context.Context)`
JS: `WindowShow()` + +### WindowHide + +Hides the window, if it is currently visible. + +Go: `WindowHide(ctx context.Context)`
JS: `WindowHide()` + +### WindowIsNormal + +Returns true if the window not minimised, maximised or fullscreen. + +Go: `WindowIsNormal(ctx context.Context) bool`
JS: `WindowIsNormal() bool` + +### WindowSetSize + +Sets the width and height of the window. + +Go: `WindowSetSize(ctx context.Context, width int, height int)`
JS: `WindowSetSize(size: Size)` + +### WindowGetSize + +Gets the width and height of the window. + +Go: `WindowGetSize(ctx context.Context) (width int, height int)`
JS: `WindowGetSize() : Size` + +### WindowSetMinSize + +Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMinSize(ctx context.Context, width int, height int)`
JS: `WindowSetMinSize(size: Size)` + +### WindowSetMaxSize + +Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions. + +Setting a size of `0,0` will disable this constraint. + +Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`
JS: `WindowSetMaxSize(size: Size)` + +### WindowSetAlwaysOnTop + +Sets the window AlwaysOnTop or not on top. + +Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`
JS: `WindowSetAlwaysOnTop(b: Boolen)` + +### WindowSetPosition + +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)` + +### WindowGetPosition + +Gets the window position relative to the monitor the window is currently on. + +Go: `WindowGetPosition(ctx context.Context) (x int, y int)`
JS: `WindowGetPosition() : Position` + +### WindowMaximise + +Maximises the window to fill the screen. + +Go: `WindowMaximise(ctx context.Context)`
JS: `WindowMaximise()` + +### WindowUnmaximise + +Restores the window to the dimensions and position prior to maximising. + +Go: `WindowUnmaximise(ctx context.Context)`
JS: `WindowUnmaximise()` + +### WindowIsMaximised + +Returns true if the window is maximised. + +Go: `WindowIsMaximised(ctx context.Context) bool`
JS: `WindowIsMaximised() bool` + +### WindowToggleMaximise + +Toggles between Maximised and UnMaximised. + +Go: `WindowToggleMaximise(ctx context.Context)`
JS: `WindowToggleMaximise()` + +### WindowMinimise + +Minimises the window. + +Go: `WindowMinimise(ctx context.Context)`
JS: `WindowMinimise()` + +### WindowUnminimise + +Restores the window to the dimensions and position prior to minimising. + +Go: `WindowUnminimise(ctx context.Context)`
JS: `WindowUnminimise()` + +### WindowIsMinimised + +Returns true if the window is minimised. + +Go: `WindowIsMinimised(ctx context.Context) bool`
JS: `WindowIsMinimised() bool` + +### WindowSetBackgroundColour + +Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels. + +Valid values for R, G, B and A are 0-255. + +:::info Windows + +On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255. + +::: + +Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS: `WindowSetBackgroundColour(R, G, B, A)` + +## Typescript Object Definitions + +### Position + +```ts +interface Position { + x: number; + y: number; +} +``` + +### Size + +```ts +interface Size { + w: number; + h: number; +} +``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx b/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx new file mode 100644 index 00000000..1af16f77 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/dogsapi.mdx @@ -0,0 +1,245 @@ +--- +sidebar_position: 20 +--- + +# Dogs API + +```mdx-code-block +
+ +
+
+``` + +:::note + +This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples). + +::: + +In this tutorial we are going to develop an application that retrieves photos of dogs from the web and then displays them. + +### Create the project + +Let's create the application. From a terminal enter: `wails init -n dogs-api -t svelte` + +Note: We could optionally add `-ide vscode` or `-ide goland` to the end of this command if you wanted to add IDE support. + +Now let's `cd dogs-api` and start editing the project files. + +### Remove unused code + +We will start by removing some elements that we know we will not use: + +- Open `app.go` and remove the following lines: + +```go +// Greet returns a greeting for the given name +func (a *App) Greet(name string) string { + return fmt.Sprintf("Hello %s, It's show time!", name) +} +``` + +- Open `frontend/src/App.svelte` and delete all lines. +- Delete the `frontend/src/assets/images/logo-universal.png` file + +### Creating our application + +Now let's add our new Go code. + +Add the following struct declarations to `app.go` before the function definitions: + +```go +type RandomImage struct { + Message string + Status string +} + +type AllBreeds struct { + Message map[string]map[string][]string + Status string +} + +type ImagesByBreed struct { + Message []string + Status string +} +``` + +Add the following functions to `app.go` (perhaps after the existing function definitions): + +```go +func (a *App) GetRandomImageUrl() string { + response, err := http.Get("https://dog.ceo/api/breeds/image/random") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data RandomImage + json.Unmarshal(responseData, &data) + + return data.Message +} + +func (a *App) GetBreedList() []string { + var breeds []string + + response, err := http.Get("https://dog.ceo/api/breeds/list/all") + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data AllBreeds + json.Unmarshal(responseData, &data) + + for k := range data.Message { + breeds = append(breeds, k) + } + + sort.Strings(breeds) + + return breeds +} + +func (a *App) GetImageUrlsByBreed(breed string) []string { + + url := fmt.Sprintf("%s%s%s%s", "https://dog.ceo/api/", "breed/", breed, "/images") + response, err := http.Get(url) + if err != nil { + log.Fatal(err) + } + + responseData, err := ioutil.ReadAll(response.Body) + if err != nil { + log.Fatal(err) + } + + var data ImagesByBreed + json.Unmarshal(responseData, &data) + + return data.Message +} +``` + +Modify the `import` section of `app.go` to look like this: + +```go +import ( + "context" + "fmt" + "encoding/json" + "io/ioutil" + "log" + "net/http" + "sort" +) +``` + +Add the following lines to `frontend/src/App.svelte`: + + +```html + + +

Dogs API

+
+ + Click on down arrow to select a breed + + +
+
+{#if showRandomPhoto} + No dog found +{/if} +{#if showBreedPhotos} + {#each photos as photo} + No dog found + {/each} +{/if} + + +``` + + +### Testing the application + +To generate the bindings and test the application, run `wails dev`. + +### Compiling the application + +To compile the application to a single, production grade binary, run `wails build`. 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 new file mode 100644 index 00000000..2be6d845 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/current/tutorials/helloworld.mdx @@ -0,0 +1,122 @@ +--- +sidebar_position: 10 +--- + +# Hello World + +Цель этого урока — запустить наиболее базовое приложение, использующее Wails. Вы сможете: + +- Создавать новое Wails приложение +- Собирать приложение +- Запускать приложение + +:::note + +В этом уроке в качестве целевой платформы используется Windows. Вывод будет варьироваться в зависимости от вашей операционной системы. + +::: + +## Создаем новое Wails приложение + +Чтобы создать новое Wails приложение, использующее стандартный шаблон JS, вам нужно выполнить следующую команду: + +```bash +wails init -n helloworld +``` + +Вы должны увидеть что-то похожее на следующее: + +``` +Wails CLI v2.0.0 + +Initialising Project 'helloworld' +--------------------------------- + +Project Name: helloworld +Project Directory: C:\Users\leaan\tutorial\helloworld +Project Template: vanilla +Template Support: https://wails.io + +Initialised project 'helloworld' in 232ms. +``` + +Это создаст новый каталог под названием `helloworld` в текущей директории. В этом каталоге вы найдете несколько файлов: + +``` +build/ - Contains the build files + compiled application +frontend/ - Contains the frontend files +app.go - Contains the application code +main.go - The main program with the application configuration +wails.json - The project configuration file +go.mod - The go module file +go.sum - The go module checksum file +``` + +## Сборка приложения + +Чтобы собрать приложение, перейдите в новую директорию `helloworld` и запустите следующую команду: + +```bash +wails build +``` + +Вы должны увидеть что-то похожее на следующее: + +``` +Wails CLI v2.0.0 + +App Type: desktop +Platforms: windows/amd64 +Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe +Build Mode: Production +Skip Frontend: false +Compress: false +Package: true +Clean Build Dir: false +LDFlags: "" +Tags: [] +Race Detector: false + +Building target: windows/amd64 +------------------------------ + - Installing frontend dependencies: Done. + - Compiling frontend: Done. + - Generating bundle assets: Done. + - Compiling application: Done. +Built 'C:\Users\leaan\tutorial\helloworld\build\bin\helloworld.exe' in 10.616s. +``` + +Приложение собрано и сохранено в папке `build/bin`. + +## Запуск приложения + +Если мы откроем папку `build/bin` в Проводнике, то увидим исполняемый файл проекта: + +```mdx-code-block +
+ +
+
+``` + +Мы можем запустить его, просто дважды щелкнув по файлу `helloworld.exe`. + +На Mac, Wails генерирует файл `helloworld.app` который может быть запущен двойным щелчком. + +На Linux вы можете запустить приложение с помощью файла `./helloworld` из папки `build/bin`. + +Вы должны видеть приложение, работающее так, как ожидалось: + +```mdx-code-block +
+ +
+
+``` diff --git a/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json index 49cf4687..e85885a4 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json +++ b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0-rc.1.json @@ -4,11 +4,11 @@ "description": "The label for version v2.0.0-rc.1" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "Приступая к работе", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "Справочник", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { @@ -16,23 +16,23 @@ "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "Сообщество", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { - "message": "Showcase", + "message": "Примеры", "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "Инструкции", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "Учебные материалы", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "Помощь проекту", "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-docs/version-v2.0.0.json b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0.json index 421c838e..5363dcc9 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0.json +++ b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.0.0.json @@ -4,11 +4,11 @@ "description": "The label for version v2.0.0" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "Приступая к работе", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "Справочник", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { @@ -16,23 +16,23 @@ "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "Сообщество", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { - "message": "Showcase", + "message": "Примеры", "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "Инструкции", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "Учебные материалы", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "Помощь проекту", "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-docs/version-v2.1.0.json b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.1.0.json index f29e6b24..8cbb330c 100644 --- a/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.1.0.json +++ b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.1.0.json @@ -4,11 +4,11 @@ "description": "The label for version v2.1.0" }, "sidebar.docs.category.Getting Started": { - "message": "Getting Started", + "message": "Приступая к работе", "description": "The label for category Getting Started in sidebar docs" }, "sidebar.docs.category.Reference": { - "message": "Reference", + "message": "Справочник", "description": "The label for category Reference in sidebar docs" }, "sidebar.docs.category.Runtime": { @@ -16,23 +16,23 @@ "description": "The label for category Runtime in sidebar docs" }, "sidebar.docs.category.Community": { - "message": "Community", + "message": "Сообщество", "description": "The label for category Community in sidebar docs" }, "sidebar.docs.category.Showcase": { - "message": "Showcase", + "message": "Примеры", "description": "The label for category Showcase in sidebar docs" }, "sidebar.docs.category.Guides": { - "message": "Guides", + "message": "Инструкции", "description": "The label for category Guides in sidebar docs" }, "sidebar.docs.category.Tutorials": { - "message": "Tutorials", + "message": "Учебные материалы", "description": "The label for category Tutorials in sidebar docs" }, "sidebar.docs.link.Contributing": { - "message": "Contributing", + "message": "Помощь проекту", "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-docs/version-v2.2.0.json b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.2.0.json new file mode 100644 index 00000000..505f74c4 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-docs/version-v2.2.0.json @@ -0,0 +1,38 @@ +{ + "version.label": { + "message": "v2.2.0", + "description": "The label for version v2.2.0" + }, + "sidebar.docs.category.Getting Started": { + "message": "Приступая к работе", + "description": "The label for category Getting Started in sidebar docs" + }, + "sidebar.docs.category.Reference": { + "message": "Справочник", + "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": "Сообщество", + "description": "The label for category Community in sidebar docs" + }, + "sidebar.docs.category.Showcase": { + "message": "Примеры", + "description": "The label for category Showcase in sidebar docs" + }, + "sidebar.docs.category.Guides": { + "message": "Инструкции", + "description": "The label for category Guides in sidebar docs" + }, + "sidebar.docs.category.Tutorials": { + "message": "Учебные материалы", + "description": "The label for category Tutorials in sidebar docs" + }, + "sidebar.docs.link.Contributing": { + "message": "Помощь проекту", + "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 new file mode 100644 index 00000000..dca54f25 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/changelog.mdx @@ -0,0 +1,570 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +## [Unreleased] + +### Added +- Added `OpenInspectorOnStartup` to debug options to allow opening the WebInspector during startup of the application in debug mode. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2080) +- On macOS `wails doctor` now also shows the version of Xcode installed. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2089) +- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091) + +### Fixed +- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081) +- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103) + +## v2.2.0 - 2022-11-09 + +### Added + +- Wails now uses a purpose built, native Go implementation of Microsoft's webview2loader dll. This means there is no need to embed the `Webview2Loader.dll` file in your binaries, meaning filesizes will be ~130k smaller! Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/1974)! +- This release provides much more control over custom asset handling via the new [AssetServer](https://wails.io/docs/reference/options#assetserver) options. This allows you to provide your own custom asset handler and hook into the request chain through middleware. Thanks to @stffabi for this [awesome contribution](https://github.com/wailsapp/wails/pull/2016) and @mholt for the [initial idea](https://github.com/wailsapp/wails/issues/2007) and extensive testing. +- It is now possible to customise the layout of your Wails projects using 2 new options in `wails.json`: + - `build:dir` can be used to specify where the build files reside + - `frontend:dir` can be used to specify where the frontend files reside + - If `go.mod` is not found in the same directory as `wails.json`, the cli will look up the parent directories to find it. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2009) +- Colour output in the CLI can now be turned off by using the `--nocolor` flag. This is useful for CI/CD pipelines. Thanks to @scottopell for the [PR](https://github.com/wailsapp/wails/pull/1947) +- A JSON schema definition for the `wails.json` file has been added. IDEs should now provide code complete when editing `wails.json`. Thanks to @binyamin for the [PR](https://github.com/wailsapp/wails/pull/1864) +- The `EventsOn*` methods now return a function that can be called to deregister the listener. Thanks to @joshbuddy for the [PR](https://github.com/wailsapp/wails/pull/1969) + +### Fixed + +- Webview2 on Windows returns a potential whitespace when defining the style like this style="--wails-draggable: drag". Fixed by @stffabi in https://github.com/wailsapp/wails/pull/1989 +- Bound structs that had `struct{}` field types would cause the Typescript generation to fail. Thanks to @ParkourLiu for the [PR](https://github.com/wailsapp/wails/pull/1999) +- When maximising a frameless window on Windows with multiple monitors, the window could sometimes become blank. Thanks to @stffabi for the [fix](https://github.com/wailsapp/wails/pull/2043) + +### Changed + +- The troubleshooting guide was updated to provide guidance when [Vite fails to start](https://wails.io/docs/guides/troubleshooting#cannot-start-service-host-version-xxx-does-not-match-binary-version-xxx). Thanks to @willdot for the [PR](https://github.com/wailsapp/wails/pull/2000). +- English, Chinese and Japanese documentation updates. Thanks to @misitebao. + +### Deprecated + +- The [AssetsHandler](https://wails.io/docs/reference/options#assetshandler) option has been deprecated. Please use the [AssetServer](https://wails.io/docs/reference/options#assetserver) option instead. + +### New Contributors + +- @willdot made their first contribution in https://github.com/wailsapp/wails/pull/2000 +- @ParkourLiu made their first contribution in https://github.com/wailsapp/wails/pull/1999 +- @binyamin made their first contribution in https://github.com/wailsapp/wails/pull/1864 +- @joshbuddy made their first contribution in https://github.com/wailsapp/wails/pull/1969 +- @sgosiaco made their first contribution in https://github.com/wailsapp/wails/pull/2062 + +## v2.1.0 - 2022-10-18 + +### Removed + +- The `RGBA` option in `options.App` has now been removed. Use `BackgroundColour` instead. + +### Added + +- [Support for defaulting to No button in Windows dialogs](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony in https://github.com/wailsapp/wails/pull/1875 +- Add missing resize for frameless window on Linux - @Lyimmi in https://github.com/wailsapp/wails/pull/1918 +- [Add window transparency for linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi in https://github.com/wailsapp/wails/pull/1926 +- [Add WindowExecJS method](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony in https://github.com/wailsapp/wails/pull/1927 +- [Add support for `Info.dev.plist` on macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony in https://github.com/wailsapp/wails/pull/1960 +- [Add ZoomFactor get/set and add the respective windows only options](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye in https://github.com/wailsapp/wails/pull/1463 + +### Fixed + +- Embed directories auto-created if they don't exist - @leaanthony in https://github.com/wailsapp/wails/pull/1983 +- Quote command arguments if they have a space - @leaanthony in https://github.com/wailsapp/wails/pull/1892 +- Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916 +- Fix gtk_window_begin_resize_drag's mouse button - @Lyimmi in https://github.com/wailsapp/wails/pull/1920 +- Fix binding generation special cases - @JulioDRF in https://github.com/wailsapp/wails/pull/1902 +- Remove the `.git` directory in the template - @misitebao in https://github.com/wailsapp/wails/pull/1929 +- Fix wails dev - @JulioDRF in https://github.com/wailsapp/wails/pull/1931 +- Fix for considering new `go` files in dev filesystem watcher - @scottopell in https://github.com/wailsapp/wails/pull/1946 +- Prevent type parsing to interfere with Typescript package name - @ValentinTrinque in https://github.com/wailsapp/wails/pull/1942 +- [dev] Do not try to infer assetdir from fs.FS when a frontend dev server is in use - @stffabi in https://github.com/wailsapp/wails/pull/1972 +- Fix init command not listed in wails help message - @lyon-lee-dev in https://github.com/wailsapp/wails/pull/1976 + +### Changed + +- Add PR checks - @leaanthony in https://github.com/wailsapp/wails/pull/1879 +- Auto label project cards - @leaanthony in https://github.com/wailsapp/wails/pull/1881 +- Add issue translator - @leaanthony in https://github.com/wailsapp/wails/pull/1891 +- Update label names in the issue template - @misitebao in https://github.com/wailsapp/wails/pull/1893 +- obfuscated instead of obfuscate in the docs - @arifali123 in https://github.com/wailsapp/wails/pull/1895 +- [assetHandler] Remove redundant log prefix - @stffabi in https://github.com/wailsapp/wails/pull/1896 +- [dev] Do not generate bindings in the dev app itself - @stffabi in https://github.com/wailsapp/wails/pull/1899 +- Update Chinese translation - @almas1992 in https://github.com/wailsapp/wails/pull/1894 +- Refactor app - @leaanthony in https://github.com/wailsapp/wails/pull/1909 +- Update documents - @misitebao in https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936 +- Adding Tutorial link - @raguay in https://github.com/wailsapp/wails/pull/1903 +- Add react-ts-vite-tailwind template - @hotafrika in https://github.com/wailsapp/wails/pull/1930 +- Update README.zh-Hans.md - @o8x in https://github.com/wailsapp/wails/pull/1949 +- Add Elm Tailwind CSS community template - @rnice01 in https://github.com/wailsapp/wails/pull/1939 +- Chore/generate sponsors - @leaanthony in https://github.com/wailsapp/wails/pull/1965 +- Use swc + pnpm for website - @leaanthony in https://github.com/wailsapp/wails/pull/1966 +- Sort structs in models.ts - @leaanthony in https://github.com/wailsapp/wails/pull/1961 +- Update Sponsor Image - @github-actions in https://github.com/wailsapp/wails/pull/1973 +- docs: sync documents - @misitebao in https://github.com/wailsapp/wails/pull/1968 +- Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979 + +### New Contributors + +- @arifali123 made their first contribution in https://github.com/wailsapp/wails/pull/1895 +- @almas1992 made their first contribution in https://github.com/wailsapp/wails/pull/1894 +- @JulioDRF made their first contribution in https://github.com/wailsapp/wails/pull/1902 +- @hotafrika made their first contribution in https://github.com/wailsapp/wails/pull/1930 +- @scottopell made their first contribution in https://github.com/wailsapp/wails/pull/1946 +- @o8x made their first contribution in https://github.com/wailsapp/wails/pull/1949 +- @rnice01 made their first contribution in https://github.com/wailsapp/wails/pull/1939 +- @cuigege made their first contribution in https://github.com/wailsapp/wails/pull/1979 +- @lyon-lee-dev made their first contribution in https://github.com/wailsapp/wails/pull/1976 + +## v2.0.0 - 2022-09-22 + +### Fixed + +- Fix buildtags parsing if only one tag is specified by @stffabi in https://github.com/wailsapp/wails/pull/1858 +- Use embed all to include all files in templates by @stffabi in https://github.com/wailsapp/wails/pull/1862 + +### Changed + +- Bump minimum required Go version to 1.18 by @stffabi in https://github.com/wailsapp/wails/pull/1854 +- Add check for minimum required Go version by @stffabi in https://github.com/wailsapp/wails/pull/1853 +- chore: update README and workflows by @misitebao in https://github.com/wailsapp/wails/pull/1848 +- Update introduction.mdx by @ParvinEyvazov in https://github.com/wailsapp/wails/pull/1863 +- Releasetest/release workflow by @leaanthony in https://github.com/wailsapp/wails/pull/1869 +- Optimize documentation website by @misitebao in https://github.com/wailsapp/wails/pull/1849 + +### New Contributors + +- @ParvinEyvazov made their first contribution in https://github.com/wailsapp/wails/pull/1863 + +## v2.0.0-rc.1 - 2022-09-13 + +### Deprecated + +- The `-noGen` flag for the `wails dev` command has been replaced with `-skipbindings`. This is to align with the `wails build` command. + +### Added + +- Add garble support by @leaanthony in https://github.com/wailsapp/wails/pull/1793 +- Make draggable CSS property customisable by @leaanthony in https://github.com/wailsapp/wails/pull/1828 +- Add Some WindowState by @zandercodes in https://github.com/wailsapp/wails/pull/1349 +- Make EventsOff capable of removing multiple listeners by @Lyimmi in https://github.com/wailsapp/wails/pull/1822 + +### Fixed + +- Use `Promise` when Go routine does not output by @SheetJSDev in https://github.com/wailsapp/wails/pull/1821 +- preact-ts template build fix by @Debdut in https://github.com/wailsapp/wails/pull/1781 +- fix frontend/tsconfig.js by @Lyimmi in https://github.com/wailsapp/wails/pull/1795 +- fix: fix bugs in website by @misitebao in https://github.com/wailsapp/wails/pull/1810 +- Fix vue-ts template by @leaanthony in https://github.com/wailsapp/wails/pull/1813 +- Remove duplicate defs in win32/window.go by @AlbinoDrought in https://github.com/wailsapp/wails/pull/1832 + +### Changed + +- Upgrade React to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1744 +- Upgrade Lit to use Vite v3 by @leaanthony in https://github.com/wailsapp/wails/pull/1745 +- Support vite3 for Vue by @leaanthony in https://github.com/wailsapp/wails/pull/1746 +- Preact templates for vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1770 +- Prevent env variables and registry overrides from changing behaviour by @stffabi in https://github.com/wailsapp/wails/pull/1771 +- Use go implementation to retrieve the version of a fixed runtime by @stffabi in https://github.com/wailsapp/wails/pull/1790 +- Change contribution guide type from "doc" to "page" by @misitebao in https://github.com/wailsapp/wails/pull/1777 +- feat(website): repair document content by @misitebao in https://github.com/wailsapp/wails/pull/1775 +- chore: sort out files by @misitebao in https://github.com/wailsapp/wails/pull/1776 +- Add Korean to doc by @jaesung9507 in https://github.com/wailsapp/wails/pull/1774 +- Add README.ja.md by @shinshin86 in https://github.com/wailsapp/wails/pull/1783 +- Reorganized contribution guidelines page by @misitebao in https://github.com/wailsapp/wails/pull/1784 +- fix(website): fix link by @misitebao in https://github.com/wailsapp/wails/pull/1785 +- Update templates.mdx by @KiddoV in https://github.com/wailsapp/wails/pull/1799 +- Better watcher by @leaanthony in https://github.com/wailsapp/wails/pull/1827 +- Only set GDK_BACKEND to "x11" if GDK_BACKEND is unset and XDG_SESSION_TYPE is not "wayland" by @prurigro in https://github.com/wailsapp/wails/pull/1811 +- Optimize images by @imgbot in https://github.com/wailsapp/wails/pull/1812 + +### New Contributors + +- @shinshin86 made their first contribution in https://github.com/wailsapp/wails/pull/1783 +- @Debdut made their first contribution in https://github.com/wailsapp/wails/pull/1781 +- @KiddoV made their first contribution in https://github.com/wailsapp/wails/pull/1799 +- @zandercodes made their first contribution in https://github.com/wailsapp/wails/pull/1349 +- @prurigro made their first contribution in https://github.com/wailsapp/wails/pull/1811 +- @SheetJSDev made their first contribution in https://github.com/wailsapp/wails/pull/1821 +- @AlbinoDrought made their first contribution in https://github.com/wailsapp/wails/pull/1832 +- @imgbot made their first contribution in https://github.com/wailsapp/wails/pull/1812 + +## v2.0.0-beta.44 - 2022-08-20 + +### Deprecated + +The `data-wails-drag` attribute is being deprecated in favour of the following CSS style: `style="--wails-draggable:drag"`. You can use `style="--wails-draggable:no-drag"` to disable the drag behaviour. For this release only, you can test this by setting the following application option: + +```go +Experimental: &options.Experimental{ + UseCSSDrag: true, +}, +``` + +### Added + +- Set file permissions for generated files by @leaanthony in https://github.com/wailsapp/wails/pull/1763 +- Experimental support for CSS Drag detection by @leaanthony in https://github.com/wailsapp/wails/pull/1750 + +### Fixed + +- Bug fix collecting of output binaries for platforms by @stffabi in https://github.com/wailsapp/wails/pull/1715 +- Fix registration of exposed fields by @ValentinTrinque in https://github.com/wailsapp/wails/pull/1727 +- Fix column widths for doctor command's dependencies table by @ianmjones in https://github.com/wailsapp/wails/pull/1717 +- Do not generate bindings for `OnBeforeClose` method + +### Changed + +- Misc code refactors and removal by @leaanthony in https://github.com/wailsapp/wails/pull/1713 +- Add react-router to routing.mdx by @Maicarons2022 in https://github.com/wailsapp/wails/pull/1755 +- Add Japanese to doc by @RyoTagami in https://github.com/wailsapp/wails/pull/1716 +- Added EmailIt and Modal File Manager by @raguay in https://github.com/wailsapp/wails/pull/1728 +- Adding my ScriptBar program by @raguay in https://github.com/wailsapp/wails/pull/1761 +- Link to general webview2 runtime download page and not to a specific language by @stffabi in https://github.com/wailsapp/wails/pull/1764 +- Updated translations in https://github.com/wailsapp/wails/pull/1719 and https://github.com/wailsapp/wails/pull/1720 +- Remove text outside style's brackets by @DragoSpiro98 in https://github.com/wailsapp/wails/pull/1765 + +### New Contributors + +- @RyoTagami made their first contribution in https://github.com/wailsapp/wails/pull/1716 +- @raguay made their first contribution in https://github.com/wailsapp/wails/pull/1728 +- @Maicarons2022 made their first contribution in https://github.com/wailsapp/wails/pull/1755 +- @DragoSpiro98 made their first contribution in https://github.com/wailsapp/wails/pull/1765 + +## v2.0.0-beta.43 - 2022-08-08 + +### Added + +- Add support for retrieving the release notes from Github by @leaanthony in https://github.com/wailsapp/wails/pull/1679 +- Add `frontend:dev:install` configuration by @LGiki in https://github.com/wailsapp/wails/pull/1666 + +### Fixed + +- Fix formatting of some error messages by @stffabi in https://github.com/wailsapp/wails/pull/1665 +- Windows dialogs now work when window is not visible yet by @leaanthony in https://github.com/wailsapp/wails/pull/1662 +- Multiple fixes for MacOS asset requests by @stffabi in https://github.com/wailsapp/wails/pull/1668 and https://github.com/wailsapp/wails/pull/1681 +- Fix for Go 1.19 by @stffabi in https://github.com/wailsapp/wails/pull/1689 +- Removed Linux warnings by @leaanthony in https://github.com/wailsapp/wails/pull/1656 +- Better support for doubleclick events in drag regions by @leaanthony in https://github.com/wailsapp/wails/pull/1704 +- Allow MacOS frameless window to be miniturisable by @leaanthony in https://github.com/wailsapp/wails/pull/1705 + +### Changed + +- add wails-sveltekit-template by @h8gi in https://github.com/wailsapp/wails/pull/1671 +- wails doctor now reports correct MacOS os id by @stffabi in https://github.com/wailsapp/wails/pull/1673 +- Update application-development.mdx by @SamHennessy in https://github.com/wailsapp/wails/pull/1682 +- Move SetMin/Max calls to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1684 +- Change `frontend:dev` to `frontend:dev:build` by @LGiki in https://github.com/wailsapp/wails/pull/1691 +- Build frontend only before starting the dev watcher command by @stffabi in https://github.com/wailsapp/wails/pull/1694 +- Improve error message for auto dev server discovery without a dev watcher by @stffabi in https://github.com/wailsapp/wails/pull/1711 + +### New Contributors + +- @h8gi made their first contribution in https://github.com/wailsapp/wails/pull/1671 +- @SamHennessy made their first contribution in https://github.com/wailsapp/wails/pull/1682 + +## v2.0.0-beta.42 - 2022-07-25 + +### Added + +- Added `options.NewRGBA` and `options.NewRGB` functions to create `*options.RGBA` by @leaanthony + +### Fixed + +- Fixed initial build of frontend when using `wails dev` on new projects by @leaanthony in https://github.com/wailsapp/wails/pull/1650 +- Ignore empty install command when running `wails dev` by @stffabi in https://github.com/wailsapp/wails/pull/1651 +- Fixed error reporting in templates +- BackgroundColour documentation fix +- Generalize manual compile steps [Documentation] by @acheong08 in https://github.com/wailsapp/wails/pull/1644 + +## v2.0.0-beta.40 - 2022-07-24 + +### Added + +- Add Show() and Hide() to runtime to show/hide application by @leaanthony in https://github.com/wailsapp/wails/pull/1599 +- Override target platform/arch using GOOS and GOARCH environment variables by @leaanthony in https://github.com/wailsapp/wails/pull/1618 +- Add option to skip frontend rebuild in dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1632 + +### Fixed + +- Update svelte templates to use vite 3 by @leaanthony in https://github.com/wailsapp/wails/pull/1643 +- Fix plain template by @stffabi in https://github.com/wailsapp/wails/pull/1609 +- Fix Website layout by @leaanthony in https://github.com/wailsapp/wails/pull/1616 +- Fixed typo in documentation page docs/howdoesitwork by @MyNameIsAres in https://github.com/wailsapp/wails/pull/1636 +- Use scaling when setting min/max window by @leaanthony in https://github.com/wailsapp/wails/pull/1557 + +### Changed + +- Install dev dependencies before starting dev mode by @leaanthony in https://github.com/wailsapp/wails/pull/1615 +- Translate and fix website text by @misitebao in https://github.com/wailsapp/wails/pull/1525 +- docs: add MyNameIsAres as a contributor for doc by @allcontributors in https://github.com/wailsapp/wails/pull/1638 +- Deprecate Fullscreen appoption by @acheong08 in https://github.com/wailsapp/wails/pull/1640 + +### Deprecated + +- The `Fullscreen` application option is deprecated. Please use [`WindowStartState`](https://wails.io/docs/reference/options#windowstartstate) instead. + +### New Contributors + +- @MyNameIsAres made their first contribution in https://github.com/wailsapp/wails/pull/1636 + +## v2.0.0-beta.39.2 - 2022-07-20 + +### Added + +- Update example for macOS Menu by @acheong08 in https://github.com/wailsapp/wails/pull/1600 + +### Fixed + +- Reinstate Go 1.17 compatibility by @leaanthony in https://github.com/wailsapp/wails/pull/1605 + +## v2.0.0-beta.39 - 2022-07-19 + +### Added + +- New screen dimensions runtime API by @skamensky in https://github.com/wailsapp/wails/pull/1519 +- Auto discover vite devserver port by @leaanthony in https://github.com/wailsapp/wails/pull/1547 +- Add nixpkgs support to doctor command. by @ianmjones in https://github.com/wailsapp/wails/pull/1551 +- New pre-build hooks feature by @leaanthony in https://github.com/wailsapp/wails/pull/1578 +- New production log level option by @leaanthony in https://github.com/wailsapp/wails/pull/1555 + +### Fixed + +- Fix stack corruption in Windows when using ICoreWebView2HttpHeadersCollectionIterator by @stffabi in https://github.com/wailsapp/wails/pull/1589 +- Move WindowGet\* to main thread by @leaanthony in https://github.com/wailsapp/wails/pull/1464 +- Allow -appargs flag to pass flags to binary. by @ianmjones in https://github.com/wailsapp/wails/pull/1534 +- Fix checking for installed apt package in none English session. by @ianmjones in https://github.com/wailsapp/wails/pull/1548 +- Fix OnBeforeClose code for Mac by @leaanthony in https://github.com/wailsapp/wails/pull/1558 +- Support Maps in TS conversion by @leaanthony in https://github.com/wailsapp/wails/pull/1435 +- Check for line length when scanning for local devserver url by @leaanthony in https://github.com/wailsapp/wails/pull/1566 +- Remove usage of unsafe.Pointer in winc by @stffabi and @leaanthony in https://github.com/wailsapp/wails/pull/1556 + +### Changed + +- Rename WindowSetRGBA -> WindowSetBackgroundColour by @leaanthony in https://github.com/wailsapp/wails/pull/1506 +- Improvements to the dev command by @stffabi in https://github.com/wailsapp/wails/pull/1510 +- Update vscode template by @leaanthony in https://github.com/wailsapp/wails/pull/1398 +- Bump svelte from 3.42.2 to 3.49.0 in /v2/internal/frontend/runtime/dev by @dependabot in https://github.com/wailsapp/wails/pull/1572 +- Bump svelte from 3.42.5 to 3.49.0 in /v2/internal/frontend/runtime by @dependabot in https://github.com/wailsapp/wails/pull/1573 +- Add troubleshooting for `Not Found` error by @acheong08 in https://github.com/wailsapp/wails/pull/1586 +- Docs/better homepage by @leaanthony in https://github.com/wailsapp/wails/pull/1591 + +### New Contributors + +- @skamensky made their first contribution in https://github.com/wailsapp/wails/pull/1519 +- @acheong08 made their first contribution in https://github.com/wailsapp/wails/pull/1586 + +**Full Changelog**: https://github.com/wailsapp/wails/compare/v2.0.0-beta.38...v2.0.0-beta.39 + +## v2.0.0-beta.38 - 2022-06-27 + +### Added + +- Add race detector to build & dev by @Lyimmi in https://github.com/wailsapp/wails/pull/1426 +- [linux] Support `linux/arm` architecture by @Lyimmi in https://github.com/wailsapp/wails/pull/1427 +- Create gitignore when using `-g` option by @jaesung9507 in https://github.com/wailsapp/wails/pull/1430 +- [windows] Add Suspend/Resume callback support by @leaanthony in https://github.com/wailsapp/wails/pull/1474 +- Add runtime function `WindowSetAlwaysOnTop` by @chenxiao1990 in https://github.com/wailsapp/wails/pull/1442 +- [windows] Allow setting browser path by @NanoNik in https://github.com/wailsapp/wails/pull/1448 + +### Fixed + +- [linux] Improve switching to main thread for callbacks by @stffabi in https://github.com/wailsapp/wails/pull/1392 +- [windows] Fix WebView2 minimum runtime version check by @stffabi in https://github.com/wailsapp/wails/pull/1456 +- [linux] Fix apt command syntax (#1458) by @abtin in https://github.com/wailsapp/wails/pull/1461 +- [windows] Set Window Background colour if provided + debounce redraw option by @leaanthony in https://github.com/wailsapp/wails/pull/1466 +- Fix small typo in docs by @LukenSkyne in https://github.com/wailsapp/wails/pull/1449 +- Fix the url to surge by @andywenk in https://github.com/wailsapp/wails/pull/1460 +- Fixed theme change at runtime by @leaanthony in https://github.com/wailsapp/wails/pull/1473 +- Fix: Don't stop if unable to remove temporary bindings build by @leaanthony in https://github.com/wailsapp/wails/pull/1465 +- [windows] Pass the correct installationStatus to the webview installation strategy by @stffabi in https://github.com/wailsapp/wails/pull/1483 +- [windows] Make `SetBackgroundColour` compatible for `windows/386` by @stffabi in https://github.com/wailsapp/wails/pull/1493 +- Fix lit-ts template by @Orijhins in https://github.com/wailsapp/wails/pull/1494 + +### Changed + +- [windows] Load WebView2 loader from embedded only by @stffabi in https://github.com/wailsapp/wails/pull/1432 +- Add showcase entry for October + update homepage carousel entry for October by @marcus-crane in https://github.com/wailsapp/wails/pull/1436 +- Always use return in wrapped method by @leaanthony in https://github.com/wailsapp/wails/pull/1410 +- [windows] Unlock OSThread after native calls have been finished by @stffabi in https://github.com/wailsapp/wails/pull/1441 +- Add `BackgroundColour` and deprecate `RGBA` by @leaanthony in https://github.com/wailsapp/wails/pull/1475 +- AssetsHandler remove retry logic in dev mode by @stffabi in https://github.com/wailsapp/wails/pull/1479 +- Add Solid JS template to docs by @sidwebworks in https://github.com/wailsapp/wails/pull/1492 +- Better signal handling by @leaanthony in https://github.com/wailsapp/wails/pull/1488 +- Chore/react 18 create root by @tomanagle in https://github.com/wailsapp/wails/pull/1489 + +### New Contributors + +- @jaesung9507 made their first contribution in https://github.com/wailsapp/wails/pull/1430 +- @LukenSkyne made their first contribution in https://github.com/wailsapp/wails/pull/1449 +- @andywenk made their first contribution in https://github.com/wailsapp/wails/pull/1460 +- @abtin made their first contribution in https://github.com/wailsapp/wails/pull/1461 +- @chenxiao1990 made their first contribution in https://github.com/wailsapp/wails/pull/1442 +- @NanoNik made their first contribution in https://github.com/wailsapp/wails/pull/1448 +- @sidwebworks made their first contribution in https://github.com/wailsapp/wails/pull/1492 +- @tomanagle made their first contribution in https://github.com/wailsapp/wails/pull/1489 + +## v2.0.0-beta.37 - 2022-05-26 + +### Added + +- Add `nogen` flag in wails dev command by @mondy in https://github.com/wailsapp/wails/pull/1413 +- Initial support for new native translucency in Windows Preview by @leaanthony in https://github.com/wailsapp/wails/pull/1400 + +### Fixed + +- Bugfix/incorrect bindings by @leaanthony in https://github.com/wailsapp/wails/pull/1383 +- Fix runtime.js events by @polikow in https://github.com/wailsapp/wails/pull/1369 +- Fix docs formatting by @antimatter96 in https://github.com/wailsapp/wails/pull/1372 +- Events | fixes #1388 by @lambdajack in https://github.com/wailsapp/wails/pull/1390 +- bugfix: correct typo by @tmclane in https://github.com/wailsapp/wails/pull/1391 +- Fix typo in docs by @LGiki in https://github.com/wailsapp/wails/pull/1393 +- Fix typo bindings.js to ipc.js by @rayshoo in https://github.com/wailsapp/wails/pull/1406 +- Make sure to execute the menu callbacks on a new goroutine by @stffabi in https://github.com/wailsapp/wails/pull/1403 +- Update runtime.d.ts & templates by @Yz4230 in https://github.com/wailsapp/wails/pull/1421 +- Add missing className to input in React and Preact templates by @edwardbrowncross in https://github.com/wailsapp/wails/pull/1419 + +### Changed + +- Improve multi-platform builds by @stffabi in https://github.com/wailsapp/wails/pull/1373 +- During wails dev only use reload logic if no AssetsHandler are in use by @stffabi in https://github.com/wailsapp/wails/pull/1385 +- Update events.mdx by @Junkher in https://github.com/wailsapp/wails/pull/1387 +- Add Next.js template by @LGiki in https://github.com/wailsapp/wails/pull/1394 +- Add docs on wails generate module by @TechplexEngineer in https://github.com/wailsapp/wails/pull/1414 +- Add macos custom menu EditMenu tips by @daodao97 in https://github.com/wailsapp/wails/pull/1423 + +### New Contributors + +- @polikow made their first contribution in https://github.com/wailsapp/wails/pull/1369 +- @antimatter96 made their first contribution in https://github.com/wailsapp/wails/pull/1372 +- @Junkher made their first contribution in https://github.com/wailsapp/wails/pull/1387 +- @lambdajack made their first contribution in https://github.com/wailsapp/wails/pull/1390 +- @LGiki made their first contribution in https://github.com/wailsapp/wails/pull/1393 +- @rayshoo made their first contribution in https://github.com/wailsapp/wails/pull/1406 +- @TechplexEngineer made their first contribution in https://github.com/wailsapp/wails/pull/1414 +- @mondy made their first contribution in https://github.com/wailsapp/wails/pull/1413 +- @Yz4230 made their first contribution in https://github.com/wailsapp/wails/pull/1421 +- @daodao97 made their first contribution in https://github.com/wailsapp/wails/pull/1423 +- @edwardbrowncross made their first contribution in https://github.com/wailsapp/wails/pull/1419 + +## v2.0.0-beta.36 - 2022-04-27 + +### Fixed + +- [v2] Validate devServer property to be of the correct form by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1359 +- [v2, darwin] Initialize native variables on stack to prevent segfault by [@stffabi](https://github.com/stffabi) in https://github.com/wailsapp/wails/pull/1362 +- Vue-TS template fix + +### Changed + +- Added `OnStartup` method back to default templates + +## v2.0.0-beta.35 - 2022-04-27 + +### Breaking Changes + +- When data was sent to the `EventsOn` callback, it was being sent as a slice of values, instead of optional parameters to the method. `EventsOn` now works as expected, but you will need to update your code if you currently use this. [More information](https://github.com/wailsapp/wails/issues/1324) +- The broken `bindings.js` and `bindings.d.ts` files have been replaced by a new JS/TS code generation system. More details [here](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) + +### Added + +- **New Templates**: Svelte, React, Vue, Preact, Lit and Vanilla templates, both JS and TS versions. `wails init -l` for more info. +- Default templates now powered by [Vite](https://vitejs.dev). This enables lightning fast reloads when you use `wails dev`! +- Add support for external frontend development servers. See `frontend:dev:serverUrl` in the [project config](https://wails.io/docs/reference/project-config) - [@stffabi](https://github.com/stffabi) +- [Fully configurable dark mode](https://wails.io/docs/reference/options#theme) for Windows. +- Hugely improved [WailsJS generation](https://wails.io/docs/howdoesitwork#calling-bound-go-methods) (both Javascript and Typescript) +- Wails doctor now reports information about the wails installation - [@stffabi](https://github.com/stffabi) +- Added docs for [code-signing](https://wails.io/docs/guides/signing) and [NSIS installer](https://wails.io/docs/guides/windows-installer) - [@gardc](https://github.com/gardc) +- Add support for `-trimpath` [build flag](https://wails.io/docs/reference/cli#build) +- Add support for a default AssetsHandler - [@stffabi](https://github.com/stffabi) + +### Fixed + +- Improved mimetype detection for BOM marker and comments - [@napalu](https://github.com/napalu) +- Remove duplicate mimetype entries - [@napalu](https://github.com/napalu) +- Remove duplicate Typescript imports in generated definition files - [@adalessa](https://github.com/adalessa) +- Add missing method declaration - [@adalessa](https://github.com/adalessa) +- Fix Linux sigabrt on start - [@napalu](https://github.com/napalu) +- Double Click event now works on elements with `data-wails-drag` attribute - [@jicg](https://github.com/jicg) +- Suppress resizing during minimize of a frameless window - [@stffabi](https://github.com/stffabi) +- Fixed TS/JS generation for Go methods with no returns +- Fixed WailsJS being generated in project directory + +### Changed + +- Website docs are now versioned +- Improved `runtime.Environment` call +- Improve the close action for Mac +- A bunch of dependabot security updates +- Improved website content - [@misitebao](https://github.com/misitebao) +- Upgrade issue template - [@misitebao](https://github.com/misitebao) +- Convert documents that don't require version management to individual pages + - [@misitebao](https://github.com/misitebao) +- Website now using Algolia search + +## v2.0.0-beta.34 - 2022-03-26 + +### Added + +- Add support for 'DomReady' callback on linux by [@napalu](https://github.com/napalu) in #1249 +- MacOS - Show extension by default by [@leaanthony](https://github.com/leaanthony) in #1228 + +### Fixed + +- [v2, nsis] Seems like / as path separator works only for some directives in a cross platform way by [@stffabi](https://github.com/stffabi) in #1227 +- import models on binding definition by [@adalessa](https://github.com/adalessa) in #123 + + 1 + +- Use local search on website by [@leaanthony](https://github.com/leaanthony) in #1234 +- Ensure binary resources can be served by [@napalu](https://github.com/napalu) in #1240 +- Only retry loading assets when loading from disk by [@leaanthony](https://github.com/leaanthony) in #1241 +- [v2, windows] Fix maximised start state by [@stffabi](https://github.com/stffabi) in #1243 +- Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. by [@ianmjones](https://github.com/ianmjones) in #1245 +- Fix memory leak in ExecJS for Mac by [@leaanthony](https://github.com/leaanthony) in #1230 +- Fix, or at least a workaround, for (#1232) by [@BillBuilt](https://github.com/BillBuilt) in #1247 +- [v2] Use os.Args[0] for self starting wails by [@stffabi](https://github.com/stffabi) in #1258 +- [v2, windows] Windows switch scheme: https -> http by @stefpap in #1255 +- Ensure Focus is regained by Webview2 when tabbing by [@leaanthony](https://github.com/leaanthony) in #1257 +- Try to focus window when Show() is called. by [@leaanthony](https://github.com/leaanthony) in #1212 +- Check system for user installed Linux dependencies by [@leaanthony](https://github.com/leaanthony) in #1180 + +### Changed + +- feat(website): sync documents and add content by [@misitebao](https://github.com/misitebao) in #1215 +- refactor(cli): optimize default templates by [@misitebao](https://github.com/misitebao) in #1214 +- Run watcher after initial build by [@leaanthony](https://github.com/leaanthony) in #1216 +- Feature/docs update by [@leaanthony](https://github.com/leaanthony) in #1218 +- feat(website): optimize website and sync documents by [@misitebao](https://github.com/misitebao) in #1219 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1224 +- Default index page by [@leaanthony](https://github.com/leaanthony) in #1229 +- Build added win32 compatibility by [@fengweiqiang](https://github.com/fengweiqiang) in #1238 +- docs: sync documents by [@misitebao](https://github.com/misitebao) in #1260 + +## v2.0.0-beta.33 - 2022-03-05 + +### Added + +- NSIS Installer support for creating installers for Windows applications - Thanks [@stffabi](https://github.com/stffabi) 🎉 +- New frontend:dev:watcher command to spin out 3rd party watchers when using wails dev - Thanks [@stffabi](https://github.com/stffabi)🎉 +- Remote templates now support version tags - Thanks [@misitebao](https://github.com/misitebao) 🎉 + +### Fixed + +- A number of fixes for ARM Linux providing a huge improvement - Thanks [@ianmjones](https://github.com/ianmjones) 🎉 +- Fixed potential Nil reference when discovering the path to `index.html` +- Fixed crash when using `runtime.Log` methods in a production build +- Improvements to internal file handling meaning webworkers will now work on Windows - Thanks [@stffabi](https://github.com/stffabi)🎉 + +### Changed + +- The Webview2 bootstrapper is now run as a normal user and doesn't require admin rights +- The docs have been improved and updated +- Added troubleshooting guide diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/coc.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/coc.mdx new file mode 100644 index 00000000..a027c627 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/coc.mdx @@ -0,0 +1,83 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at coc@wails.io. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][mozilla coc]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][faq]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/community-guide.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/community-guide.mdx new file mode 100644 index 00000000..dc7753d9 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/community-guide.mdx @@ -0,0 +1,141 @@ +# Community Guide + +The number of Wails users is growing at an incredible rate, and if you're reading this, chances are you're ready to join. So... welcome! + +## Resources + +### Code of Conduct + +This [Code of Conduct](./coc) is an easy guide to develop the technical communities in which we participate. + +### Stay in the Know + +- Follow our [official Twitter account](https://twitter.com/wailsapp). + +### Get Support + +- [GitHub](https://github.com/wailsapp/wails) - If you have a bug to report or feature to request, that's what the GitHub issues are for. Please respect the rules specified in each repository's issue template. +- [Slack](https://gophers.slack.com/messages/CJ4P9F7MZ/) - A place for Wails devs to meet and chat in real time. +- [QQ Group(中文)](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - A Wails group for Chinese developers to communicate, where you can get help from other developers. + +### Explore the Ecosystem + +- [The Awesome Wails Page](https://github.com/wailsapp/awesome-wails) - See what other awesome resources have been published by other awesome people. + +## Ways of contributing + +Wails is an open source, community driven project. We welcome anyone to join us in contributing to the project. This documentation is aimed at anyone wishing to get familiar with the project and the development processes. + +There are many ways to contribute to the project: + +- Developing new features +- Fixing bugs +- Testing +- Documenting features +- Writing tutorials / guides +- Helping others on the issues + discussions boards + +Guides for these have been created in their own sections. Before getting started, please introduce yourself in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion. + +### Developing New Features + +We are always keen to add features to Wails and expand on what the project can do. The process for adding new features are as follows: + +- Pick an enhancement ticket with the "TODO" label. It's preferable to select one from the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) but the choice is yours. +- Before developing, check that the ticket includes the following information: + - The purpose of the enhancement + - What is out of scope for the enhancement + - What platforms the enhancement targets (most features should be cross-platform unless there's a very specific reason) +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. Sometimes placeholder tickets are created and require more details +- Comment on the ticket stating if you wish to develop the feature +- Clone the repository and create a branch with the format `feature/_` +- New features often require documentation so please ensure you have also added or updated the documentation as part of the changes +- Once the feature is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all enhancement requests are reviewed for good fit. Not all ideas will be selected, so it's best to have discussion about the enhancement first. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Fixing Bugs + +The process for fixing bugs are as follows: + +- Check the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) and select a bug to fix +- Before developing, check that the ticket includes the following information: +- The scope of the issue including platforms affected +- The steps to reproduce. Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) +- The output of `wails doctor` +- If the ticket does not include this information, feel free to request the information from the person who opened the ticket. +- Comment on the ticket stating you wish to develop a fix +- Clone the repository and create a branch with the format `bugfix/_` +- Once the fix is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and test cases listed with checkmarks, so that others can know what still needs to be tested. +- Once all the testing is completed, please update the status of the PR from draft and leave a message. + +:::note +There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all bugfixes should be discussed as the approach may have unintended side effects. +::: + +:::warning +Any PRs opened without a corresponding ticket may be rejected. +::: + +### Testing + +Testing is vitally important to ensure quality in the project. There are a couple of scenarios where testing can really help the project: + +- Testing if a bug is reproducible on your local system +- Testing PRs to ensure that they work correctly + +If you chose to test if someone's bug report is reproducible on your local system, then feel free to add a comment on the ticket confirming this with the output of `wails doctor`. + +To test PRs, choose a PR to test and check if the PR description has the testing scenarios listed. If not, please ask the person who opened the PR to provide that list. Once you have determined a valid test scenario, please report your findings on the PR. + +If you ever need more clarity or help on testing, please ask a question in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520) discussion or on slack. + +### Documenting + +This website is also the main documentation site for the project. Sometimes this gets out of date and needs some slight adjustments. Some of the documentation isn't written to the best standards either. Developing documentation is hard and so any contribution to this is greatly appreciated. Features without documentation are unfinished so to the project, it's _as important_ as the code. + +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. + +To set up a local documentation development environment, do the following: + +- [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. + +#### Versioning + +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. + +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. + +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. + +#### Languages + +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. + +##### 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. + +### 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 slack channel. 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. + +To join the Wails slack channel, accept the invite [here](https://gophers.slack.com/join/shared_invite/zt-197vymgt3-sJt4oyakb6nqlVKjXTyeVw#/shared-invite/email) and join us on the channel by following [this link](https://gophers.slack.com/?redir=%2Fmessages%2FCJ4P9F7MZ%2F). + +:::note + +Work In Progress + +::: diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx new file mode 100644 index 00000000..651a1257 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/credits.mdx @@ -0,0 +1,199 @@ +# Credits + +- [Lea Anthony](https://github.com/leaanthony) - Project owner, lead developer +- [Stffabi](https://github.com/stffabi) - Technical lead, developer and maintainer +- [Misite Bao](https://github.com/misitebao) - Мастер документации, перевод на китайский язык, тестирование Windows, общий поиск ошибок +- [Travis McLane](https://github.com/tmclane) - кросс-компиляция, тестирование MacOS +- [Byron Chris](https://github.com/bh90210) - Linux distro wizard, Linux testing + +## Sponsors + + +## Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Lea Anthony

💻 🤔 🎨 🖋 💡 🧑‍🏫 📆 🔧 🐛 📝 🚧 📦 👀 💬 🔬 ⚠️ 📢 👀 📖

stffabi

💻 🤔 🎨 🐛 🚧 📦 👀 💬 🔬 👀 📖 ⚠️

Travis McLane

💻 🔬 📦 🤔 🐛 👀 ⚠️ 💬 📖

Misite Bao

📖 🌍 🔬 🚧

Byron Chris

💻 🔬 🚧 🐛 👀 ⚠️ 💬 🤔 🎨 📦 🚇

konez2k

💻 📦 🤔

Dario Emerson

💻 🐛 🤔 ⚠️

Ian M. Jones

💻 🐛 🤔 ⚠️ 👀 📦

marktohark

💻

Ryan H

💻

Cody Bentley

💻 📦 🤔 💵

Florent

💻 🐛

Alexander Hudek

💻 💵

Tim Kipp

💻

Altynbek Kaliakbarov

💻

Nikolai Zimmermann

💻

k-muchmore

💻

Snider

💻 🤔 📖 💵

Albert Sun

💻 ⚠️

Ariel

💻 🐛

Ilgıt Yıldırım

💻 🐛 💵

Toyam Cox

💻 📦 🐛

hi019

💻 🐛

Arthur Wiebe

💻 🐛

Balakrishna Prasad Ganne

💻

BillBuilt

💻 📦 🤔 💬 💵

Eng Zer Jun

🚧 💻

LGiki

📖

Lontten

📖

Lukas Crepaz

💻 🐛

Marcus Crane

🐛 📖 💵

Qais Patankar

📖

Wakeful-Cloud

💻 🐛

Zámbó, Levente

💻 📦 🐛 ⚠️

Ironpark

💻 🤔

mondy

💻 📖

Benjamin Ryan

🐛

fallendusk

📦 💻

Mat Ryer

💻 🤔 🐛

Abtin

💻 🐛

Adrian Lanzafame

📦 💻

Aleksey Polyakov

🐛 💻

Alexander Matviychuk

💻 📦

AlienRecall

💻 📦

Aman

📖

Amaury Tobias Quiroz

💻 🐛

Andreas Wenk

📖

Antonio Stanković

💻 📦

Arpit Jain

📖

Austin Schey

💻 🐛

Benjamin Thomas

💻 📦 🤔

Bertram Truong

💻 🐛

Blake Bourque

📖

Denis

📖

diogox

💻 📦

Dmitry Gomzyakov

💻 📦

Edward Browncross

💻

Elie Grenon

💻

Florian Didron

💻 🐛 🤔 ⚠️ 👀 📦

GargantuaX

💵

Igor Minin

💻 🐛

Jae-Sung Lee

💻 🤔

Jarek

💻 📦

Junker

📖

Kris Raney

💻 🐛

Luken

📖

Mark Stenglein

💻 🐛

buddyabaddon

💻

MikeSchaap

💻 🐛

NYSSEN Michaël

💻 🐛

Nan0

💻 🤔 ⚠️ 👀

oskar

📖

Pierre Joye

💻 🐛 🤔 ⚠️

Reuben Thomas-Davis

💻 🐛

Robin

💻 🐛

Sebastian Bauer

💻 🤔 ⚠️ 👀 💬

Sidharth Rathi

📖 🐛

Sithembiso Khumalo

💻 🐛

Soheib El-Harrache

💻 🐛 💵

Sophie Au

💻 🐛

Stefanos Papadakis

💻 🐛

Steve Chung

💻 🐛

Timm Ortloff

📖

Tom

💻

Valentin Trinqué

💻 🐛

mattn

💻 🐛

bearsh

💻 🤔 📖

chenxiao

💻 🤔 📖

fengweiqiang

💻 📦

flin7

📖

fred21O4

📖

gardc

📖

rayshoo

📖

Ishiyama Yuzuki

💻 🐛

佰阅

💻

刀刀

📖 🐛

归位

💻 🐛

skamensky

💻 🤔 📖

dependabot[bot]

💻 🚧

Damian Sieradzki

💵

John Dorman

💵

Ian Sinnott

💵

Arden Shackelford

💵

Bironou

💵

CharlieGo_

💵

overnet

💵

jugglingjsons

💵

Selvin Ortiz

💵

ZanderCodes

💵

Michael Voronov

💵

letheanVPN

💵

Tai Groot

💵

easy-web-it

💵

Michael Olson

💵

EdenNetwork Italia

💵

ondoki

💵

QuEST Rail LLC

💵

Gilgameš

💵

Bernt-Johan Bergshaven

💵

Liam Bigelow

💵

Nick Arellano

💵

Frank Chiarulli Jr.

💵

Tyler

💵

Trea Hauet

💵

Kent 'picat' Gruber

💵

tc-hib

💵

Antonio

📖

MyNameIsAres

📖

Maicarons J

📖

kiddov

📖 💵 ⚠️ 🤔

Nicolas Coutin

💵

Parvin Eyvazov

📖
+ + + + + + +## Special Mentions + +- [John Chadwick](https://github.com/jchv) - His amazing work on [go-webview2](https://github.com/jchv/go-webview2) and [go-winloader](https://github.com/jchv/go-winloader) have made the Windows version possible. +- [Tad Vizbaras](https://github.com/tadvi) - His winc project was the first step down the path to a pure Go Wails. +- [Mat Ryer](https://github.com/matryer) - For advice, support and bants. +- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been invaluable. +- [Justen Walker](https://github.com/justenwalker/) - For helping wrangle COM issues which got v2 over the line. +- [Wang, Chi](https://github.com/patr0nus/) - The DeskGap project was a huge influence on the direction of Wails v2. +- [Serge Zaitsev](https://github.com/zserge) - Whilst Wails does not use the Webview project, it is still a source of inspiration. diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/faq.mdx b/website/i18n/ru/docusaurus-plugin-content-pages/faq.mdx new file mode 100644 index 00000000..a5da6d37 --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/faq.mdx @@ -0,0 +1,9 @@ +# ЧаВо + +## Почему такое название? + +Когда я увидел WebView, я подумал: «То, что мне действительно нужно, это создание приложения WebView, немного похожее на Rails на Ruby». Изначально это была игра на словах (**W**ebview on R**ails**). Это так же оказалось омофоном английского названия страны из которой я родом. Так и осталось. + +## Является ли это альтернативой Electron? + +Зависит от ваших требований. Программа предназначена для программистов Go создавать легкие десктопные приложения или добавлять интерфейс к существующим приложениям. Wails v2 предлагает нативные элементы, такие как меню и диалоги, поэтому он становится легковесной альтернативой электрону. diff --git a/website/i18n/ru/docusaurus-plugin-content-pages/markdown-page.md b/website/i18n/ru/docusaurus-plugin-content-pages/markdown-page.md new file mode 100644 index 00000000..42f8795f --- /dev/null +++ b/website/i18n/ru/docusaurus-plugin-content-pages/markdown-page.md @@ -0,0 +1,7 @@ +--- +title: Пример Markdown страницы +--- + +# Пример Markdown страницы + +Вам не нужен React для написания простых отдельных страниц. diff --git a/website/i18n/ru/docusaurus-theme-classic/footer.json b/website/i18n/ru/docusaurus-theme-classic/footer.json index da81b249..2216bec7 100644 --- a/website/i18n/ru/docusaurus-theme-classic/footer.json +++ b/website/i18n/ru/docusaurus-theme-classic/footer.json @@ -1,26 +1,26 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Документация", "description": "The title of the footer links column with title=Docs in the footer" }, "link.title.Community": { - "message": "Community", + "message": "Сообщество", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { - "message": "More", + "message": "Больше", "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Introduction": { - "message": "Introduction", + "message": "Введение", "description": "The label of footer link with label=Introduction linking to /docs/introduction" }, "link.item.label.Getting Started": { - "message": "Getting Started", + "message": "Приступая к работе", "description": "The label of footer link with label=Getting Started linking to /docs/gettingstarted/installation" }, "link.item.label.Changelog": { - "message": "Changelog", + "message": "История изменений", "description": "The label of footer link with label=Changelog linking to /changelog" }, "link.item.label.Github": { @@ -28,7 +28,7 @@ "description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails" }, "link.item.label.Twitter": { - "message": "Twitter", + "message": "Твиттер", "description": "The label of footer link with label=Twitter linking to https://twitter.com/wailsapp" }, "link.item.label.Slack": { @@ -43,12 +43,12 @@ "message": "Blog", "description": "The label of footer link with label=Blog linking to /blog" }, - "link.item.label.Awesome": { - "message": "Awesome", - "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" - }, "copyright": { "message": "Copyright © 2022 Lea Anthony", "description": "The footer copyright" + }, + "link.item.label.Awesome": { + "message": "Awesome", + "description": "The label of footer link with label=Awesome linking to https://github.com/wailsapp/awesome-wails" } } diff --git a/website/i18n/ru/docusaurus-theme-classic/navbar.json b/website/i18n/ru/docusaurus-theme-classic/navbar.json index 00196043..91b8d205 100644 --- a/website/i18n/ru/docusaurus-theme-classic/navbar.json +++ b/website/i18n/ru/docusaurus-theme-classic/navbar.json @@ -1,42 +1,42 @@ { "item.label.Sponsor": { - "message": "Sponsor", + "message": "Спонсоры ❤", "description": "Navbar item with label Sponsor" }, "item.label.Docs": { - "message": "Docs", + "message": "Документация", "description": "Navbar item with label Docs" }, "item.label.Blog": { "message": "Blog", "description": "Navbar item with label Blog" }, - "item.label.About": { - "message": "About", - "description": "Navbar item with label About" - }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" }, + "item.label.About": { + "message": "О нас", + "description": "Navbar item with label About" + }, "item.label.FAQ": { - "message": "FAQ", + "message": "ЧаВо", "description": "Navbar item with label FAQ" }, "item.label.Changelog": { - "message": "Changelog", + "message": "Журнал изменений", "description": "Navbar item with label Changelog" }, "item.label.Community Guide": { - "message": "Community Guide", + "message": "Руководство сообщества", "description": "Navbar item with label Community Guide" }, - "item.label.Code of Conduct": { - "message": "Code of Conduct", - "description": "Navbar item with label Code of Conduct" - }, "item.label.Credits": { "message": "Credits", "description": "Navbar item with label Credits" + }, + "item.label.Code of Conduct": { + "message": "Правила поведения", + "description": "Navbar item with label Code of Conduct" } } 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 fd127f9b..a880bfdb 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 @@ -25,6 +25,7 @@ func main() { Height: 600, DisableResize: false, Fullscreen: false, + WindowStartState: options.Maximised, Frameless: true, MinWidth: 400, MinHeight: 400, @@ -47,7 +48,6 @@ func main() { OnDomReady: app.domready, OnShutdown: app.shutdown, OnBeforeClose: app.beforeClose, - WindowStartState: options.Maximised, CSSDragProperty: "--wails-draggable", CSSDragValue: "drag", ZoomFactor: 1.0, @@ -72,11 +72,11 @@ func main() { LightModeTitleText: windows.RGB(20, 20, 20), LightModeBorder: windows.RGB(200, 200, 200), }, - // User messages that can be customised + // 可自定义的用户消息 Messages *windows.Messages - // OnSuspend is called when Windows enters low power mode + // Windows 进入低功耗模式时调用 OnSuspend OnSuspend func() - // OnResume is called when Windows resumes from low power mode + // Windows 从低功耗模式恢复时调用 OnResume OnResume func() }, Mac: &mac.Options{ @@ -105,6 +105,7 @@ func main() { OpenInspectorOnStartup: false, }, }) + if err != nil { log.Fatal(err) } @@ -138,9 +139,19 @@ func main() { ### 全屏 -将此设置为 `true` 将在启动时使窗口全屏。 +已弃用:请使用 [窗口启动状态](#窗口启动状态). -名称:Fullscreen
类型:`bool` +### 窗口启动状态 + +定义窗口在启动时应如何呈现。 + +| 值 | Win | Mac | Lin | +| -------------- | --- | --- | --- | +| Fullscreen(全屏) | ✅ | ✅ | ✅ | +| Maximised(最大化) | ✅ | ✅ | ✅ | +| Minimised(最小化) | ✅ | ❌ | ✅ | + +名称:WindowStartState
类型:`options.WindowStartState` ### 无边框 @@ -246,10 +257,9 @@ func main() { 资产处理程序是一个通用的 `http.Handler`,用于对无法找到的资产进行后备处理。 -由于 `os.ErrNotExist`,对于每个无法从 [资产](#资产) 提供服务的 GET 请求,都会调用该处理程序。 此外,所有非 GET 请求将始终从此处理程序提供服务。 +由于 `os.ErrNotExist`,对于每个无法从 [资产](#资产) 提供服务的 GET 请求,都会调用该处理程序。 此外,所有非 GET 请求将始终从此处理程序提供服务。 如果未定义,则调用处理程序的结果如下: -如果未定义,则调用处理程序的结果如下: -- GET 请求: `http.StatusNotFound` +- GET 请求: `http.StatusNotFound` - 其他请求: `http.StatusMethodNotAllowed` 注意:当与前端 DevServer 结合使用时,可能会有一些限制,例如。 Vite 在不包含文件扩展名的每个路径上提供 index.html。 @@ -335,30 +345,30 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { 名称:OnBeforeClose
类型:`func(ctx context.Context) bool` -### 窗口启动状态 - -定义窗口在启动时应如何呈现。 - -| 值 | Win | Mac | Lin | -| ---------- | --- | --- | --- | -| Fullscreen | ✅ | ✅ | ✅ | -| Maximised | ✅ | ✅ | ✅ | -| Minimised | ✅ | ❌ | ✅ | - -名称:WindowStartState
类型:`options.WindowStartState` - -### CSSDragProperty +### CSS 拖动属性 指示用于标识哪些元素可用于拖动窗口的 CSS 属性。 默认值:`--wails-draggable` 名称:CSSDragProperty
类型:`string` -### CSSDragValue +### CSS 拖动值 指示 `CSSDragProperty` 样式应该具有什么值才能拖动窗口。 默认值:`drag` 名称:CSSDragValue
类型:`string` +### 缩放比例 + +名称:ZoomFactor
类型:`float64` + +这定义了 WebView2 的缩放比例。 这是匹配 Edge 用户激活放大或缩小的选项 + +### 启用缩放比例 + +名称:IsZoomControlEnabled
类型:`bool` + +这将允许用户更改缩放比例。 请注意,可以在选项中设置缩放比例,但不允许在运行时更改它。 适用于屏幕固定的或类似的应用程序。 + ### 绑定 定义需要绑定到前端的方法的结构实例切片。 @@ -437,18 +447,6 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) { 名称:WebviewBrowserPath
类型:`string` -### 缩放比例 - -名称:ZoomFactor
类型:`float64` - -这定义了 WebView2 的缩放比例。 这是匹配 Edge 用户激活放大或缩小的选项 - -### 启用缩放比例 - -名称:IsZoomControlEnabled
类型:`bool` - -这将允许用户更改缩放比例。 请注意,可以在选项中设置缩放比例,但不允许在运行时更改它。 适用于屏幕固定的或类似的应用程序。 - #### 主题 最低 Windows 版本:Windows 10 2004/20H1 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 7a70e2df..72c7866d 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-pages/changelog.mdx @@ -20,6 +20,7 @@ ### 修复 - wails dev 中 `noreload` 标志未被应用。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2081) 中修复。 +- `build/bin` 文件夹在 `wails dev` 模式下每次重新加载时都会复制自身。 由 @OlegGulevskyy 在这个 [PR](https://github.com/wailsapp/wails/pull/2103) 中修复。 ## v2.2.0 - 2022-11-09