5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 06:19:43 +08:00

docs: fix and sync documents (#2135)

* docs: standardize JavaScript and TypeScript name writing

* docs: sync translated documents

* docs: fix broken link

* docs: sync translated documents
This commit is contained in:
Misite Bao 2022-11-28 17:13:22 +08:00 committed by GitHub
parent 6d975b965b
commit 73caeb9793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
217 changed files with 1425 additions and 1390 deletions

View File

@ -150,7 +150,7 @@ connects to it. All connected web browsers will respond to system events like ho
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
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.

View File

@ -89,7 +89,7 @@ connects to it. All connected web browsers will respond to system events like ho
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
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.

View File

@ -73,7 +73,7 @@ connects to it. All connected web browsers will respond to system events like ho
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
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.

View File

@ -43,7 +43,7 @@ as it covers all the major changes in more detail. In summary:
- 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).
- 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.

View File

@ -20,5 +20,5 @@ go-linq 3.2
Frontend with:
Vue 2.6.11
Vuex 3.4.0
Typescript
TypeScript
Tailwind 1.9.6

View File

@ -7,7 +7,7 @@ sidebar_position: 5
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
- 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

View File

@ -26,61 +26,61 @@ import TabItem from "@theme/TabItem";
]}
>
<TabItem value="Svelte">
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t svelte
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t svelte-ts
</TabItem>
<TabItem value="React">
Generate a <a href={"https://reactjs.org/"}>React</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://reactjs.org/"}>React</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t react
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t react-ts
</TabItem>
<TabItem value="Vue">
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t vue
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vue-ts
</TabItem>
<TabItem value="Preact">
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t preact
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t preact-ts
</TabItem>
<TabItem value="Lit">
Generate a <a href={"https://lit.dev/"}>Lit</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://lit.dev/"}>Lit</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t lit
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t lit-ts
</TabItem>
<TabItem value="Vanilla">
Generate a Vanilla project using Javascript with:<br/><br/>
Generate a Vanilla project using JavaScript with:<br/><br/>
wails init -n myproject -t vanilla
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vanilla-ts

View File

@ -126,7 +126,7 @@ The _biggest_ change in v2 is how assets are handled.
In v1, assets were passed via 2 application options:
- `JS` - The application's Javascript
- `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

View File

@ -112,9 +112,9 @@ 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
## The generated TypeScript doesn't have the correct types
Sometimes the generated Typescript doesn't have the correct types. To mitigate this,
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).

View File

@ -6,9 +6,9 @@ sidebar_position: 20
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
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.
JavaScript methods that can be called, just as if they were local JavaScript methods.
```mdx-code-block
<div className="text--center">
@ -121,7 +121,7 @@ Just before the frontend is about to load `index.html`, a callback is made to th
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.
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).
@ -130,7 +130,7 @@ option [OnBeforeClose](reference/options.mdx#onbeforeclose).
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
public (starts with an uppercase letter) and will generate JavaScript versions of those methods that can be called
by the frontend code.
:::info Note
@ -208,9 +208,9 @@ You may bind as many structs as you like. Just make sure you create an instance
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
- 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.
@ -231,7 +231,7 @@ the frontend and your Go code are:
### Calling bound Go methods
When you run your application with `wails dev`, it will automatically generate Javascript bindings for your structs in a
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:
@ -244,9 +244,9 @@ wailsjs
└─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:
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
// ...
@ -259,7 +259,7 @@ function doGreeting(name) {
}
```
The Typescript declaration file gives you the correct types for the bound methods:
The TypeScript declaration file gives you the correct types for the bound methods:
```ts
export function Greet(arg1: string): Promise<string>;
@ -268,29 +268,29 @@ export function Greet(arg1: string): Promise<string>;
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
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.
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.
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
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.
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
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.
model between Go and JavaScript.
Example: We update our `Greet` method to accept a `Person` instead of a string:
@ -408,7 +408,7 @@ section of the [Application Development Guide](guides/application-development.md
### Calling runtime methods
The Javascript runtime is located at `window.runtime` and contains many methods to do various
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"

View File

@ -14,8 +14,8 @@ and power of Go, combined with a rich, modern frontend.
- 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
- 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
@ -40,8 +40,8 @@ you'd expect from a modern native app.
### 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.
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
@ -51,15 +51,15 @@ 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
### 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.
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,
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

View File

@ -161,7 +161,7 @@ Your system is ready for Wails development!
- 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
- 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.

View File

@ -6,7 +6,7 @@ sidebar_position: 5
This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes.
:::info Javascript
:::info JavaScript
Dialog is currently unsupported in the JS runtime.

View File

@ -4,7 +4,7 @@ sidebar_position: 2
# Events
The Wails runtime provides a unified events system, where events can be emitted or received by either Go or Javascript.
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

View File

@ -4,7 +4,7 @@ sidebar_position: 1
# Introduction
The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime
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:
@ -29,8 +29,8 @@ you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ond
:::
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
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

View File

@ -4,7 +4,7 @@ sidebar_position: 3
# Log
The Wails runtime provides a logging mechanism that may be called from Go or Javascript. Like most
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
@ -110,7 +110,7 @@ Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
### LogSetLogLevel
Sets the log level. In Javascript, the number relates to the following log levels:
Sets the log level. In JavaScript, the number relates to the following log levels:
| Value | Log Level |
| ----- | --------- |

View File

@ -6,7 +6,7 @@ sidebar_position: 6
These methods are related to the application menu.
:::info Javascript
:::info JavaScript
Menu is currently unsupported in the JS runtime.

View File

@ -233,7 +233,7 @@ Any value that is not 0 will be considered 255.
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/>
JS: `WindowSetBackgroundColour(R, G, B, A)`
## Typescript Object Definitions
## TypeScript Object Definitions
### Position

View File

@ -1,30 +1,30 @@
{
"homepage.Features.Title1": {
"message": "homepage.Features.Title1"
"message": "Riche en fonctionnalités"
},
"homepage.Features.Description1": {
"message": "homepage.Features.Description1"
"message": "Construisez des applications multiplateformes complètes en utilisant des éléments natifs du UI tels que les menus et les boîtes de dialogue."
},
"homepage.Features.Title2": {
"message": "homepage.Features.Title2"
"message": "Familier"
},
"homepage.Features.Description2": {
"message": "homepage.Features.Description2"
"message": "Utilisez les technologies que vous connaissez déjà pour construire des applications étonnantes."
},
"homepage.Features.Title3": {
"message": "homepage.Features.Title3"
"message": "Fast"
},
"homepage.Features.Description3": {
"message": "homepage.Features.Description3"
"message": "Générez, construisez et empaquetez rapidement vos projets en utilisant le CLI Wails."
},
"homepage.Tagline": {
"message": "homepage.Tagline"
"message": "Créez de belles applications multi-plateformes en utilisant Go"
},
"homepage.ButtonText": {
"message": "homepage.ButtonText"
"message": "Premiers Pas"
},
"homepage.LearnMoreButtonText": {
"message": "homepage.LearnMoreButtonText"
"message": "En savoir plus"
},
"theme.ErrorPageContent.title": {
"message": "Cette page a planté.",
@ -35,7 +35,7 @@
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "Page introuvable",
"message": "Page non trouvée",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
@ -43,7 +43,7 @@
"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é.",
"message": "Veuillez contacter le propriétaire du site qui vous a dirigé vers cette URL et lui faire savoir que son lien est rompu.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
@ -59,7 +59,7 @@
"description": "The page & hero description of the blog archive page"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "Retour au début de la page",
"message": "Retour en haut de la page",
"description": "The ARIA label for the back to top button"
},
"theme.blog.paginator.navAriaLabel": {
@ -71,7 +71,7 @@
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Anciennes entrées",
"message": "Anciennes Entrées",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.readingTime.plurals": {
@ -79,11 +79,11 @@
"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}",
"message": "Lire la suite de {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readMore": {
"message": "Lire plus",
"message": "Lire la suite",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.paginator.navAriaLabel": {
@ -115,7 +115,7 @@
"description": "The label of the link targeting the tag list page"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copier le code",
"message": "Copier le code dans le presse-papiers",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copied": {
@ -127,7 +127,7 @@
"description": "The copy button label on code blocks"
},
"theme.colorToggle.ariaLabel": {
"message": "Basculer entre le mode sombre et clair (actuellement {mode})",
"message": "Passer du mode sombre au mode clair (actuellement {mode})",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
@ -143,7 +143,7 @@
"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",
"message": "Étendre la barre latérale",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
@ -163,7 +163,7 @@
"description": "The label used to navigate to the next doc"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Réduire le menu latéral",
"message": "Réduire la barre latérale",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
@ -230,11 +230,11 @@
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.common.skipToMainContent": {
"message": "Aller au contenu principal",
"message": "Passer 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 :",
"message": "Tags :",
"description": "The label alongside a tag list"
},
"theme.TOCCollapsible.toggleButtonLabel": {
@ -249,15 +249,15 @@
"message": "Voir les {count} résultats"
},
"theme.SearchBar.label": {
"message": "Chercher",
"message": "Recherche",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "Un document trouvé|{count} documents trouvés",
"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} »",
"message": "Résultats de la recherche pour \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
@ -265,7 +265,7 @@
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Tapez votre recherche ici",
"message": "Saisissez votre recherche ici",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
@ -281,15 +281,15 @@
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Chargement de nouveaux résultats...",
"message": "Récupération des nouveaux résultats...",
"description": "The paragraph for fetching new search results"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"message": "Tags ",
"description": "The title of the tag list page"
},
"theme.docs.breadcrumbs.home": {
"message": "Page d'accueil",
"message": "Page daccueil",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
@ -301,7 +301,7 @@
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.admonition.note": {
"message": "remarque",
"message": "note",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
@ -329,7 +329,7 @@
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "Récemment",
"message": "Récents",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
@ -337,7 +337,7 @@
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "Sauvegarder cette recherche",
"message": "Enregistrer cette recherche",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
@ -357,7 +357,7 @@
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "Vous pouvez vérifier votre connexion réseau.",
"message": "Vous devriez vérifier votre connexion réseau.",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
@ -365,7 +365,7 @@
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Touche Entrée",
"message": "La touche Entrée",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
@ -389,7 +389,7 @@
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "Recherche via",
"message": "Rechercher par",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {

View File

@ -23,15 +23,15 @@ Quand j'ai annoncé Wails pour la première fois sur Reddit, il y a deux ans dep
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.
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. Lorsque Microsoft a annoncé le passage à l'utilisation de Chromium comme nouvelle base pour leur navigateur, je savais que ce n'était qu'une question de de temps avant que Wails ne puisse l'utiliser, et que l'expérience du développeur Windows ne passe au niveau supérieur.
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...
Aujourd'hui, j'ai le plaisir d'annoncer : **Wails v2 Beta pour Windows**! Il y a énormément de stock dans cette version, donc attrape une boisson, prend un siège et nous allons commencer...
### No CGO Dependency!
### Pas de dépendance CGO !
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.
Non, je ne plaisante pas : _Pas_ _de_ _dépendance_ _CGO_ 🤯! La chose à propos de Windows est que, contrairement à MacOS et Linux, il n'est pas livré avec un compilateur par défaut. De plus, CGO a besoin d'un compilateur mingw et il y a une tonne d'options d'installation différentes. La suppression de CGO comme prérequis a simplifié considérablement la configuration et facilite grandement le débogage. Pendant que j'ai fait un effort raisonnable pour que cela fonctionne, la majorité du crédit devrait aller à [John Chadwick](https://github.com/jchv) pour non seulement démarrer quelques projets pour rendre ceci possible, mais aussi être ouvert à quelqu'un qui prend ces projets et qui en crée d'autres à partir des siens. Crédit également à [Tad Vizbaras](https://github.com/tadvi) dont le projet [winc](https://github.com/tadvi/winc) m'a lancé dans cette direction.
### WebView2 Chromium Renderer
### Moteur de rendu WebView2 Chromium
```mdx-code-block
<div class="text--center">
@ -44,15 +44,15 @@ No, I'm not joking: _No_ _CGO_ _dependency_ 🤯! The thing about Windows is tha
<br />
```
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!
Enfin, les développeurs de Windows obtiennent un moteur de rendu de première classe pour leurs applications ! Les jours à tordre votre code frontend pour le faire fonctionner sur Windows sont terminés. En plus de cela, vous obtenez une expérience avec des outils de développement de première classe !
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.
Le composant WebView2 a toutefois besoin d'avoir le `WebView2Loader.dll` de présent avec le binaire. Cela rend la distribution juste un peu plus douloureuse que ce à quoi nous sommes habitués. Toutes les solutions et bibliothèques (que je connais) qui utilisent WebView2 ont cette dépendance.
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.
Cependant, je suis vraiment heureuse d'annoncer que les applications Wails _n'ont pas de telles exigences_! Merci à la sorcellerie de [John Chadwick](https://github.com/jchv), grâce à qui nous sommes en mesure de regrouper cette dll à l'intérieur du binaire et d'obtenir que Windows la charge comme si elle était présente sur le disque.
Gophers rejoice! The single binary dream lives on!
Les Gophers se réjouissent! Le rêve d'un binaire unique vit !
### New Features
### Nouvelles fonctionnalités
```mdx-code-block
<div class="text--center">
@ -94,7 +94,7 @@ Yes, it works just like a webserver, except it isn't.
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
### Nouvelle expérience de développement
```mdx-code-block
<div class="text--center">
@ -116,7 +116,7 @@ It also provides the additional features:
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 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!
@ -137,25 +137,25 @@ Getting an application up and running quickly was always a key goal for the Wail
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
### En 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: Gos 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:
J'ai également besoin de remercier énormément les personnes suivantes :pray: parce que sans elles, cette version n'existerait tout simplement pas:
- [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.
- [Misite Bao](https://github.com/misitebao) - Un bourreau de travail absolu sur les traductions chinoises et un chercheur de bugs incroyable.
- [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 aujourd'hui d'avoir une version Windows.
- [Tad Vizbaras](https://github.com/tadvi) - Expérimenter avec son projet [winc](https://github.com/tadvi/winc) a été le premier pas vers un pur Wails en Go.
- [Mat Ryer](https://github.com/matryer) - Son soutien, ses encouragements et ses commentaires ont vraiment contribué à faire avancer le projet.
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.
Enfin, je voudrais remercier tout particulièrement tous les [sponsors du projet](/credits#sponsors), y compris [JetBrains](https://www.jetbrains.com?from=Wails), dont le soutien anime le projet de plusieurs manières en coulisses.
I look forward to seeing what people build with Wails in this next exciting phase of the project!
J'ai hâte de voir ce que les gens construisent avec Wails dans cette prochaine phase excitante du projet!
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!
PS: Les utilisateurs de MacOS et de Linux n'ont pas besoin de se sentir laissés de côté. Le portage vers ces OS est en cours et la majeure partie du travail a déjà été faite. Tenez bon !
PPS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks!
PPS : Si vous ou votre entreprise trouvez Wails utile, veuillez envisager [de parrainer le projet](https://github.com/sponsors/leaanthony). Merci !

View File

@ -74,7 +74,7 @@ It also provides the additional features:
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 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!

View File

@ -61,7 +61,7 @@ It also provides the additional features:
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 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!

View File

@ -45,7 +45,7 @@ The v2 release is a huge leap forward for the project, addressing many of the pa
- 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).
- 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.
@ -91,8 +91,8 @@ I'm really proud of what we've been able to achieve with the V2 release. It's am
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!
Profitez bien!
&dash; Lea
PS: If you or your company find Wails useful, please consider [sponsoring the project](https://github.com/sponsors/leaanthony). Thanks!
PS : Si vous ou votre entreprise trouvez Wails utile, veuillez envisager [de parrainer le projet](https://github.com/sponsors/leaanthony). Merci !

View File

@ -2,25 +2,25 @@
sidebar_position: 2
---
# Links
# Liens
This page serves as a list for community related links. Please submit a PR (click `Edit this page` at the bottom) to submit links.
Cette page sert de liste pour les liens liés à la communauté. Veuillez soumettre une PR (cliquez sur `Modifier cette page` en bas) pour soumettre des liens.
## Awesome Wails
The [definitive list](https://github.com/wailsapp/awesome-wails) of links related to Wails.
La [liste définitive](https://github.com/wailsapp/awesome-wails) de liens relatifs à Wails.
## Support Channels
## Canaux de support
- [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)
- [canal de discussion sur la bêta v2](https://github.com/wailsapp/wails/discussions/828)
## Social Media
## Réseaux sociaux
- [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
- [Groupe QQ pour la communauté chinoise de Wails](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Numéro de groupe : 1067173054
## Other Tutorials and Articles
- [Building of Bulletin Board](https://blog.customct.com/building-bulletin-board)
## Autres tutoriels et articles
- [Construction d'un Panneau d'Affichage](https://blog.customct.com/building-bulletin-board)

View File

@ -7,6 +7,6 @@
</p>
```
**[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.**
**[EncryptEasy](https://www.encrypteasy.app) est un outil de chiffrement PGP simple et facile à utiliser, qui gère toutes vos clés et celles de vos contacts. Le chiffrement devrait être simple. Développé avec 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.
Chiffrer les messages à l'aide de PGP est la norme de l'industrie. Tout le monde a une clé privée et publique. Votre clé privée, eh bien, doit être privée afin que vous seul puissiez lire les messages. Votre clé publique est distribuée à toute personne qui veut vous envoyer des messages secrets, chiffrés. Gérer les clés, chiffrer les messages et déchiffrer les messages devrait être une expérience agréable. EncryptEasy a pour but de vous simplifier la tâche.

View File

@ -1,4 +1,4 @@
# FileHound Export Utility
# Utilitaire d'exportation FileHound
```mdx-code-block
<p style={{ "text-align": "center" }}>
@ -7,10 +7,10 @@
</p>
```
[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.
[L'utilitaire d'exportation FileHound](https://www.filehound.co.uk/) est une plate-forme de gestion de documents cloud conçue pour la conservation sécurisée de fichiers, l'automatisation des processus métier et les capacités de SmartCapture.
The FileHound Export Utility allows FileHound Administrators the ability to run a secure document and data extraction tasks for alternative back-up and recovery purposes. This application will download all documents and/or meta data saved in FileHound based on the filters you choose. The metadata will be exported in both JSON and XML formats.
L'utilitaire d'exportation FileHound permet aux administrateurs FileHound d'exécuter des tâches sécurisées d'extraction de documents et de données à des fins alternatives de sauvegarde et de récupération. Cette application téléchargera tous les documents et/ou métadonnées enregistrés dans FileHound en fonction des filtres que vous avez choisis. Les métadonnées seront exportées dans les formats JSON et XML.
Backend built with: Go 1.15 Wails 1.11.0 go-sqlite3 1.14.6 go-linq 3.2
Backend construit avec: 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
Frontend with: Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6

View File

@ -11,4 +11,4 @@
</p>
```
[Minecraft Updater](https://github.com/Gurkengewuerz/MinecraftModUpdater) is a utility tool to update and synchronize Minecraft mods for your userbase. Its built using Wails2 and React with [antd](https://ant.design/) as frontend framework.
[Minecraft Updater](https://github.com/Gurkengewuerz/MinecraftModUpdater) est un outil utilitaire pour mettre à jour et synchroniser les mods Minecraft pour votre base d'utilisateurs. Il a été conçu en utilisant Wails2 et React avec [antd](https://ant.design/) comme framework frontend.

View File

@ -9,6 +9,6 @@
</p>
```
[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.
[Modal File Manager](https://github.com/raguay/ModalFileManager) est un gestionnaire de fichiers à double volet utilisant des technologies web. Mon design original était basé sur NW.js et peut être trouvé [ici](https://github.com/raguay/ModalFileManager-NWjs). Cette version utilise le même code frontend basé sur Svelte (mais il a été grandement modifié depuis le départ de NW.js), mais le backend est une implémentation de [Wails 2](https://wails.io/). En utilisant cette implémentation, je n'utilise plus de commandes en ligne de commande `rm`, `cp`, etc. Il est entièrement codé en utilisant Go et fonctionne beaucoup plus rapidement que les versions précédentes.
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.
Ce gestionnaire de fichiers est conçu autour du même principe que Vim: l'état est contrôlé par des actions via le clavier. Le nombre d'états n'est pas fixe, mais très programmable. Par conséquent, un nombre infini de configurations de clavier qui peuvent être créées et utilisées. C'est la principale différence par rapport aux autres gestionnaires de fichiers.

View File

@ -7,4 +7,4 @@
</p>
```
[Molly Wallet](https://github.com/grvlle/constellation_wallet/) the official $DAG wallet of the Constellation Network. It'll let users interact with the Hypergraph Network in various ways, not limited to producing $DAG transactions.
[Molly Wallet](https://github.com/grvlle/constellation_wallet/) le portefeuille officiel $DAG du Constellation Network. Cela permettra aux utilisateurs d'interagir avec le réseau Hypergraph de différentes manières, sans se limiter à la production de transactions en $DAG.

View File

@ -7,8 +7,8 @@
</p>
```
[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).
[Octobre](https://october.utf9k.net) est une petite application Wails qui rend vraiment facile d'extraire les surlignements de [Kobo eReaders](https://en.wikipedia.org/wiki/Kobo_eReader) puis de les transférer vers [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/)!
Il a une taille relativement petite avec toutes les versions de la plate-forme pesant en moins de 10 Mo, et c'est sans activer la [compression UPX](https://upx.github.io/)!
In contrast, the author's previous attempts with Electron quickly bloated to several hundred megabytes.
En revanche, les précédentes tentatives de l'auteur avec Electron ont rapidement gonflé à plusieurs centaines de mégaoctets.

View File

@ -7,4 +7,4 @@
</p>
```
[Optimus](https://github.com/splode/optimus) is a desktop image optimization application. It supports conversion and compression between WebP, JPEG, and PNG image formats.
[Optimus](https://github.com/splode/optimus) est une application d'optimisation d'image de bureau. Il supporte la conversion et la compression entre les formats dimages WebP, JPEG et PNG.

View File

@ -7,4 +7,4 @@
</p>
```
[Portfall](https://github.com/rekon-oss/portfall) - A desktop k8s port-forwarding portal for easy access to all your cluster UIs
[Portfall](https://github.com/rekon-oss/portfall) - Un portail de redirection de port k8 pour un accès facile à toutes les interfaces de votre instance

View File

@ -9,4 +9,4 @@
</p>
```
[Restic-Browser](https://github.com/emuell/restic-browser) - A simple, cross-platform [restic](https://github.com/restic/restic) backup GUI for browsing and restoring restic repositories.
[Restic-Browser](https://github.com/emuell/restic-browser) - Une interface de sauvegarde simple et multiplateforme [restic](https://github.com/restic/restic) pour la navigation et la restauration de dépôts restic.

View File

@ -7,15 +7,15 @@
</p>
```
Easy, Secure, and Free file sharing for everyone. Learn more at [Riftshare.app](https://riftshare.app)
Partage de fichiers facile, sécurisé et gratuit pour tout le monde. Apprenez-en plus sur [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!
- Partage facile et sécurisé de fichiers entre ordinateurs à la fois sur le réseau local et via Internet
- Supporte l'envoi de fichiers ou de répertoires de manière sécurisée par le protocole [magic wormhole](https://magic-wormhole.readthedocs.io/en/latest/)
- Compatible avec toutes les autres applications utilisant magic wormhole (magic-wormhole or wormhole-william CLI, wormhole-gui, etc.)
- Compression automatique de plusieurs fichiers sélectionnés à envoyer en même temps
- Animations complètes, barre de progression et support d'annulation pour l'envoi et la réception
- Sélection de fichier natif au système d'exploitation
- Ouvrir les fichiers en un seul clic une fois reçus
- Mise à jour automatique - ne vous inquiétez pas d'avoir la dernière version!

View File

@ -7,4 +7,4 @@
</p>
```
[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.
[Barre de scripts](https://GitHub.com/raguay/ScriptBarApp) est un programme pour afficher la sortie du serveur [Node-Red](https://nodered.org) intégré dans l'application [EmailIt](https://GitHub.com/raguay/EmailIt). Il affiche également la sortie des scripts sur votre système. ScriptBar ne les met pas dans la barre de menus, mais les a tous dans une fenêtre convenable pour une visualisation facile. Vous pouvez avoir plusieurs onglets pour voir plusieurs choses différentes. Vous pouvez également conserver les liens vers vos sites Web les plus visités.

View File

@ -7,4 +7,4 @@
</p>
```
[Surge](https://getsurge.io/) is a p2p filesharing app designed to utilize blockchain technologies to enable 100% anonymous file transfers. Surge is end-to-end encrypted, decentralized and open source.
[Surge](https://getsurge.io/) est une application de partage de fichiers p2p conçue pour utiliser les technologies blockchain afin d'activer les transferts de fichiers 100 % anonymes. Surge est chiffré de bout en bout, décentralisé et open source.

View File

@ -7,4 +7,4 @@
</p>
```
[Wally](https://ergodox-ez.com/pages/wally) is the official firmware flasher for [Ergodox](https://ergodox-ez.com/) keyboards. It looks great and is a fantastic example of what you can achieve with Wails: the ability to combine the power of Go and the rich graphical tools of the web development world.
[Wally](https://ergodox-ez.com/pages/wally) est le flasheur officiel du firmware pour les claviers [Ergodox](https://ergodox-ez.com/). C'est un excellent exemple de ce que vous pouvez réaliser avec Wails : la capacité de combiner la puissance de Go et les riches outils graphiques du monde du développement web.

View File

@ -7,4 +7,4 @@
</p>
```
[Wombat](https://github.com/rogchap/wombat) is a cross platform gRPC client.
[Wombat](https://github.com/rogchap/wombat) est un client gRPC multi-plateforme.

View File

@ -7,4 +7,4 @@
</p>
```
[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails) is an app for downloading tracks from youtube, creating offline playlists and share them with your friends, your friends will be able to playback your playlists or download them for offline listening, has an built-in player.
[Ytd](https://github.com/marcio199226/ytd/tree/v2-wails) est une application pour télécharger des pistes depuis youtube, créer des listes de lecture hors ligne et les partager avec vos amis, vos amis seront en mesure de lire vos playlists ou de les télécharger pour l'écoute hors ligne, a un lecteur intégré.

View File

@ -2,55 +2,55 @@
sidebar_position: 1
---
# Templates
# Modèles
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.
Cette page sert de liste pour les modèles supportés par la communauté. Veuillez soumettre une PR (cliquez sur `Modifier cette page` en bas) pour inclure vos modèles. Pour construire votre propre modèle, veuillez consulter le guide [Modèles](../guides/templates.mdx).
To use these templates, run `wails init -n "Your Project Name" -t [the link below[@version]]`
Pour utiliser ces modèles, exécutez `wails init -n "Votre nom de projet" -t [le lien ci-dessous[@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.
S'il n'y a pas de suffixe de version, la branche principale du modèle de code sera alors utilisé par défaut. S'il y a un suffixe de version, le modèle de code correspondant au tag de cette version sera utilisé.
Example: `wails init -n "Your Project Name" -t https://github.com/misitebao/wails-template-vue`
Exemple : `wails init -n "Votre nom de projet" -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!**
**Le projet Wails n'entretient pas, et n'est pas responsable des modèles de tierces parties!**
If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed.
Si vous n'êtes pas sûr d'un modèle, inspectez `package.json` et `wails.json` pour savoir quels scripts sont exécutés et quels paquets sont installés.
:::
## 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 &lt;script setup&gt;)
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - Modèle de Wails basé sur Vue (TypeScript intégré, thème sombre, internationalisation, routage de page unique, TailwindCSS)
- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript avec Vite (et instructions pour ajouter des fonctionnalités)
- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript avec Vite, Vuex, Vue Router, Sass, et ESLint + Prettier
- [wails-template-quasar-js](https://github.com/sgosiaco/wails-template-quasar-js) - Un modèle utilisant JavaScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier)
- [wails-template-quasar-ts](https://github.com/sgosiaco/wails-template-quasar-ts) - Un modèle utilisant TypeScript + Quasar V2 (Vue 3, Vite, Sass, Pinia, ESLint, Prettier, Composition API avec &lt;script setup&gt;)
## Angular
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular avec TypeScript, Sass, rechargement à chaud, découpage dynamique de code et 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
- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - Un modèle utilisant reactjs
- [wails-react-template](https://github.com/flin7/wails-react-template) - Un modèle minimal pour React qui supporte le développement en direct
- [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - Un modèle utilisant Next.js et TypeScript
- [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - Un modèle pour React + TypeScript + Vite + TailwindCSS
## 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
- [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - Un modèle utilisant Svelte
- [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - Un modèle utilisant Svelte et Vite
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - Un modèle utilisant Svelte et Vite avec TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - Un modèle utilisant 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.
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Développez votre application GUI avec de la programmation fonctionnelle et une configuration de développement en direct :tada: :rocket:
- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Combine les puissances :muscle: d'Elm + Tailwind CSS + Wails ! Rechargement automatique pris en charge.
## 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
- [wails-pure-js-template](https://github.com/KiddoV/wails-pure-js-template) - Un modèle avec rien que du JavaScript, du HTML et du CSS de base

View File

@ -7,7 +7,7 @@ sidebar_position: 5
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
- 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

View File

@ -26,61 +26,61 @@ import TabItem from "@theme/TabItem";
]}
>
<TabItem value="Svelte">
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t svelte
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t svelte-ts
</TabItem>
<TabItem value="React">
Generate a <a href={"https://reactjs.org/"}>React</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://reactjs.org/"}>React</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t react
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t react-ts
</TabItem>
<TabItem value="Vue">
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t vue
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vue-ts
</TabItem>
<TabItem value="Preact">
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t preact
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t preact-ts
</TabItem>
<TabItem value="Lit">
Generate a <a href={"https://lit.dev/"}>Lit</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://lit.dev/"}>Lit</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t lit
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t lit-ts
</TabItem>
<TabItem value="Vanilla">
Generate a Vanilla project using Javascript with:<br/><br/>
Generate a Vanilla project using JavaScript with:<br/><br/>
wails init -n myproject -t vanilla
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vanilla-ts

View File

@ -118,7 +118,7 @@ The _biggest_ change in v2 is how assets are handled.
In v1, assets were passed via 2 application options:
- `JS` - The application's Javascript
- `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.

View File

@ -105,9 +105,9 @@ 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
## 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).
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

View File

@ -10,7 +10,7 @@ By using the `-webview2` flag when building, you can decide what your applicatio
1. Download
2. Embed
3. Browser
3. Navigateur
4. Error
### Download
@ -21,7 +21,7 @@ This option will prompt the user that no suitable runtime has been found and the
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
### Navigateur
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.

View File

@ -2,9 +2,9 @@
sidebar_position: 20
---
# How does it work?
# Comment ça marche ?
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.
Une application Wails est une application Go standard, avec une interface graphique webkit. La partie Go de l'application se compose du code de l'application et d'une bibliothèque d'exécution qui fournit un certain nombre d'opérations utiles, comme le contrôle de la fenêtre de l'application. Le frontend est une fenêtre webkit qui affichera les ressources graphiques. 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
<div className="text--center">
@ -12,11 +12,11 @@ A Wails application is a standard Go application, with a webkit frontend. The Go
</div>
```
## The Main Application
## L'Application Principale
### Overview
### Vue densemble
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:
L'application principale consiste en un seul appel à `wails.Run()`. Il accepte la configuration de l'application qui décrit la taille de la fenêtre d'application, le titre de la fenêtre, qu'elles sont les ressources à utiliser, etc. Une application de base pourrait ressembler à ceci :
```go title="main.go"
package main
@ -71,20 +71,20 @@ func (b *App) Greet(name string) string {
}
```
### Options rundown
### Description des options
This example has the following options set:
Cet exemple a les options suivantes :
- `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
- `Title` - Le texte qui devrait apparaître dans la barre de titre de la fenêtre
- `Width` & `Height` - Les dimensions de la fenêtre
- `Assets` - Les ressources du frontend de l'application
- `OnStartup` - Nom de la fonction à appeler quand la fenêtre est créée et est sur le point de commencer à charger les ressources du frontend
- `OnShutdown` - Nom de la fonction à appeler quand la fenêtre est sur le point d'être fermée
- `Bind` - La liste des structures Go à exposer au frontend
A full list of application options can be found in the [Options Reference](reference/options).
Une liste complète des options d'application peut être trouvée dans la [Référence d'options](reference/options).
#### Assets
#### Ressources
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`:
@ -103,11 +103,11 @@ More details can be found in the [Application Development Guide](guides/applicat
#### 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).
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.
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
@ -184,15 +184,15 @@ You may bind as many structs as you like. Just make sure you create an instance
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
- 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
## Le frontend
### Overview
### Vue densemble
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:
@ -201,7 +201,7 @@ The frontend is a collection of files rendered by webkit. It's like a browser an
### 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:
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
@ -211,7 +211,7 @@ wailsjs
└─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:
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
// ...
@ -224,27 +224,27 @@ function doGreeting(name) {
}
```
The Typescript declaration file gives you the correct types for the bound methods:
The TypeScript declaration file gives you the correct types for the bound methods:
```ts
export function Greet(arg1: string): Promise<string>;
```
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.
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.
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.
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.
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.
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:
@ -356,9 +356,9 @@ The combination of generated bindings and TypeScript models makes for a powerful
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
### Appeler les méthodes runtime
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:
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);

View File

@ -6,22 +6,22 @@ sidebar_position: 1
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.
Considérez cela comme une alternative légère et rapide d'Electron pour Go. Vous pouvez facilement construire des applications avec la flexibilité et la puissance de Go, combinée à un frontend riche et moderne.
### Features
### Fonctionnalités
- 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
- Menus natifs, Boîtes de dialogues, Thèmes et Translucidité
- Prise en charge de Windows, macOS et Linux
- Modèles intégrés pour Svelte, React, Preact, Vue, Lit et Vanilla JS
- Easily call Go methods from JavaScript
- Génération automatique du modèle TypeScript à partir de struct Go
- Aucun CGO ou DLL externe requis sous Windows
- Mode développement en direct en utilisant la puissance de [Vite](https://vitejs.dev/)
- CLI puissant pour créer, construire et empaqueter facilement des applications
- Une riche bibliothèque [runtime](/docs/reference/runtime/intro)
- Les applications construites avec Wails sont conformes aux Stores Apple & Microsoft
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.
Ceci est [varly](https://varly.app) - une application de bureau pour MacOS & Windows écrite à l'aide de Wails. Non seulement elle est belle, elle utilise les menus natifs et la translucidité - tout ce que vous pouvez attendre d'une application native moderne.
```mdx-code-block
<p class="text--center">
@ -34,42 +34,42 @@ This is [varly](https://varly.app) - a desktop application for MacOS & Windows w
</p>
```
### Quick Start Templates
### Modèles de créations rapides
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.
Wails est livré avec un certain nombre de modèles préconfigurés qui vous permettent de faire fonctionner votre application rapidement. Il y a des modèles pour les frameworks suivants : Svelte, React, Vue, Preact, Lit et Vanilla. Il existe à la fois des versions JavaScript et TypeScript pour chaque modèle.
### Native Elements
### Éléments natifs
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.
Wails utilise une bibliothèque conçue pour gérer les éléments natifs tels que les fenêtres, menus, boîtes de dialogues, etc, pour que vous puissiez construire des applications de bureau riches en fonctionnalités.
**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.
**Il n'embarque pas de navigateur**, il est donc efficace sur les ressources. Au lieu de cela, il utilise le moteur de rendu natif de la plate-forme. Sous Windows, c'est la nouvelle bibliothèque Microsoft Webview2, construite sur Chromium.
### Go & Javascript Interoperability
### 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.
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
### Librairie d'exécution
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.
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
### Expérience de développement en direct
#### Automatic Rebuilds
#### Reconstructions automatiques
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.
Lorsque vous exécutez votre application en mode "dev", Wails construira votre application en tant qu'application de bureau native, mais lira vos ressources depuis le disque. Il détectera toutes les modifications apportées à votre code Go, puis reconstruira et relancera automatiquement votre application .
#### Automatic Reloads
#### Rechargement automatique
When changes to your application assets are detected, your running application will "reload", reflecting your changes almost immediately.
Lorsque des changements sont détectés dans les ressources de votre application, votre application en cours d'exécution sera "rechargée", reflétant presque immédiatement vos modifications .
#### Develop your application in a Browser
#### Développez votre application dans un navigateur
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.
Si vous préférez déboguer et vous développer dans un navigateur, Wails vous couvre. L'application en cours d'exécution a également un serveur web qui exécutera votre application depuis n'importe quel navigateur qui s'y connecte. Il sera aussi actualisé lorsque vos fichiers seront modifiés.
### Production-ready Native Binaries
### Binaires natifs prêts à la production
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.
Lorsque vous êtes prêt à faire une version finale de votre application, le CLI le compilera en un seul exécutable, avec tous les actifs qui y sont intégrés. Sous Windows et MacOS, il est possible de créer un paquet natif pour la distribution. Les ressources utilisées dans la compilation de l'application (icône, info. list, fichier manifest, etc) font partie de votre projet et peuvent être personnalisés, ce qui vous donne le contrôle total sur la façon dont vos applications sont construites.
### Tooling
### Outils
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!
Le CLI Wails fournit un moyen sans tracas de générer, de construire et de regrouper vos applications. Il s'occupera de la lourde tâche de créer des icônes, de compiler votre application avec des paramètres optimaux et de fournir un binaire distribuable et prêt à la production. Choisissez parmi un certain nombre de modèles de démarrage pour démarrer rapidement !

View File

@ -157,7 +157,7 @@ Your system is ready for Wails development!
- 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
- 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.

View File

@ -2,33 +2,33 @@
sidebar_position: 5
---
# Project Config
# Configuration du projet
The project config resides in the `wails.json` file in the project directory. The structure of the config is:
La configuration du projet se trouve dans le fichier `wails.json` du répertoire du projet. La structure de la configuration est :
```json
{
"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.
"name": "[Le nom du projet]",
"assetdir": "[Chemin relatif vers le répertoire contenant les ressources compilées, ceci est normalement déduit et pourrait être laissé vide]",
"reloaddirs": "[Répertoires supplémentaires pour déclencher des recharges automatiques (séparés par des virgules), ceci n'est utilisé que pour certaines configurations d'actifs avancées]",
"build:dir": "[Le répertoire où se trouvent les fichiers de compilation. Par défaut, 'build']",
"frontend:dir": "[Chemin relatif vers le répertoire du frontend. Par défaut, 'frontend']',
"frontend:install": "[La commande pour installer les dépendances de node, exécuté dans le répertoire du frontend - souvent `npm install`]",
"frontend:build": "[La commande pour construire l'application, exécuté dans le répertoire frontend - souvent `npm run build`]",
"frontend:dev": "[Cette commande a été remplacée par frontend:dev:build. Si frontend:dev:build n'est pas spécifié, cela retombera dans cette commande. \nSi cette commande n'est pas non plus spécifiée va revenir sur frontend:build]",
"frontend:dev:build": "[Cette commande est l'équivalent en dev de frontend:build. Si non spécifié, revient à frontend:dev]",
"frontend:dev:install": "[Cette commande est l'équivalent en dev de frontend:install. Si non spécifié, revient à frontend:install]",
"frontend:dev:watcher": "[Cette commande est exécutée dans un processus séparé sur `wails dev`. Utile pour les observateurs tiers ou les serveurs de développement de parties tierces]",
"frontend:dev:serverUrl": "[URL vers un serveur de développement tiers pour exposer l'application, EG Vite. \nSi cette valeur est définie à 'auto', alors le devServerUrl sera déduit de la sortie Vite]",
"wailsjsdir": "[Chemin relatif au répertoire qui vont contenir les modules JS automatiquement créés]",
"version": "[Version de configuration du projet]",
"outputfilename": "[Le nom du binaire]",
"debounceMS": 100, // Nombre de millisecondes durant lesquelles le serveur de dev attend de se recharger quand il détecte un changement dans les ressourcces
"devServer": "[Adresse pour se connecter au serveur de dev de wails. Par défaut: localhost:34115]",
"appargs": "[Arguments passés à l'application en mode shell lors du mode dev]",
"runNonNativeBuildHooks": false, // Définit si les évènements de compilation doivent être exécutés même s'ils sont définis pour un système d'exploitation autre que le système d'exploitation hôte.
"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/GOARCH": "[La commande qui sera exécutée avant une compilation du GOOS/GOARCH: ${platform} est remplacée par le "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".]"
},

View File

@ -6,7 +6,7 @@ sidebar_position: 5
This part of the runtime provides access to native dialogs, such as File Selectors and Message boxes.
:::info Javascript
:::info JavaScript
Dialog is currently unsupported in the JS runtime.

View File

@ -4,7 +4,7 @@ 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.
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

View File

@ -4,14 +4,14 @@ 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.
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)
- [Boîte de dialogue](dialog.mdx)
- [Événements](events.mdx)
- [Browser](browser.mdx)
- [Log](log.mdx)
@ -23,13 +23,13 @@ Whilst the context will be provided to the [OnStartup](../options.mdx#onstartup)
:::
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.
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
### Cacher
Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
Hides the application.
Cache l'application.
:::info Note
@ -37,9 +37,9 @@ On Mac, this will hide the application in the same way as the `Hide` menu item i
:::
### Show
### Afficher
Shows the application.
Affiche l'application.
:::info Note
@ -49,15 +49,15 @@ On Mac, this will bring the application back into the foreground. For Windows an
Go: `Show(ctx context.Context)`<br/> JS: `Show()`
### Quit
### Quitter
Quits the application.
Quitte l'application.
Go: `Quit(ctx context.Context)`<br/> JS: `Quit()`
### Environment
### Environnement
Returns details of the current environment.
Renvoie les détails de l'environnement actuel.
Go: `Environment(ctx context.Context) EnvironmentInfo`<br/> JS: `Environment(): Promise<EnvironmentInfo>`

View File

@ -4,7 +4,7 @@ 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:
The Wails runtime provides a logging mechanism that may be called from Go or JavaScript. Comme la plupart des loggers, il y a un certain nombre de niveaux de log :
- Trace
- Debug
@ -13,109 +13,109 @@ The Wails runtime provides a logging mechanism that may be called from Go or Jav
- 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.
Le logger affichera tous les messages de log au niveau actuel ou supérieur. Exemple : Le niveau `Debug` affichera tous les messages sauf ceux du niveau `Trace`.
### LogPrint
Logs the given message as a raw message.
Ajoute le message donné dans les logs en tant que message brut.
Go: `LogPrint(ctx context.Context, message string)`<br/> JS: `LogPrint(message: string)`
### LogPrintf
Logs the given message as a raw message.
Ajoute le message donné dans les logs en tant que message brut.
Go: `LogPrintf(ctx context.Context, format string, args ...interface{})`<br/>
### LogTrace
Logs the given message at the `Trace` log level.
Ajoute le message donné dans les logs avec le niveau de log `Trace`.
Go: `LogTrace(ctx context.Context, message string)`<br/> JS: `LogTrace(message: string)`
### LogTracef
Logs the given message at the `Trace` log level.
Ajoute le message donné dans les logs avec le niveau de log `Trace`.
Go: `LogTracef(ctx context.Context, format string, args ...interface{})`<br/>
### LogDebug
Logs the given message at the `Debug` log level.
Ajoute le message donné dans les logs avec le niveau de log `Debug`.
Go: `LogDebug(ctx context.Context, message string)`<br/> JS: `LogDebug(message: string)`
### LogDebugf
Logs the given message at the `Debug` log level.
Ajoute le message donné dans les logs avec le niveau de log `Debug`.
Go: `LogDebugf(ctx context.Context, format string, args ...interface{})`<br/>
### LogInfo
Logs the given message at the `Info` log level.
Ajoute le message donné dans les logs avec le niveau de log `Info`.
Go: `LogInfo(ctx context.Context, message string)`<br/> JS: `LogInfo(message: string)`
### LogInfof
Logs the given message at the `Info` log level.
Ajoute le message donné dans les logs avec le niveau de log `Info`.
Go: `LogInfof(ctx context.Context, format string, args ...interface{})`<br/>
### LogWarning
Logs the given message at the `Warning` log level.
Ajoute le message donné dans les logs avec le niveau de log `Warning`.
Go: `LogWarning(ctx context.Context, message string)`<br/> JS: `LogWarning(message: string)`
### LogWarningf
Logs the given message at the `Warning` log level.
Ajoute le message donné dans les logs avec le niveau de log `Warning`.
Go: `LogWarningf(ctx context.Context, format string, args ...interface{})`<br/>
### LogError
Logs the given message at the `Error` log level.
Ajoute le message donné dans les logs avec le niveau de log `Error`.
Go: `LogError(ctx context.Context, message string)`<br/> JS: `LogError(message: string)`
### LogErrorf
Logs the given message at the `Error` log level.
Ajoute le message donné dans les logs avec le niveau de log `Error`.
Go: `LogErrorf(ctx context.Context, format string, args ...interface{})`<br/>
### LogFatal
Logs the given message at the `Fatal` log level.
Ajoute le message donné dans les logs avec le niveau de log `Fatal`.
Go: `LogFatal(ctx context.Context, message string)`<br/> JS: `LogFatal(message: string)`
### LogFatalf
Logs the given message at the `Fatal` log level.
Ajoute le message donné dans les logs avec le niveau de log `Fatal`.
Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
### LogSetLogLevel
Sets the log level. In Javascript, the number relates to the following log levels:
Définit le niveau des logs. In JavaScript, the number relates to the following log levels:
| Value | Log Level |
| ----- | --------- |
| 1 | Trace |
| 2 | Debug |
| 3 | Info |
| 4 | Warning |
| 5 | Error |
| Valeur | Niveau de log |
| ------ | ------------- |
| 1 | Trace |
| 2 | Debug |
| 3 | Info |
| 4 | Warning |
| 5 | Error |
Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`<br/> JS: `LogSetLogLevel(level: number)`
## Using a Custom Logger
## Utiliser un Logger Personnalisé
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`:
Un logger personnalisé peut être utilisé en le définissant dans l'option de l'application [Logger](../options.mdx#logger) . La seule condition est que le logger implémente l'interface `logger.Logger` définie dans `github.com/wailsapp/wails/v2/pkg/logger`:
```go title="logger.go"
type Logger interface {

View File

@ -4,22 +4,22 @@ sidebar_position: 6
# Menu
These methods are related to the application menu.
Ces méthodes sont liées au menu de l'application.
:::info Javascript
:::info JavaScript
Menu is currently unsupported in the JS runtime.
Le menu n'est actuellement pas pris en charge lors de l'exécution de JS.
:::
### MenuSetApplicationMenu
Sets the application menu to the given [menu](../menus.mdx).
Définit le menu de l'application dans le [menu](../menus.mdx) donné.
Go: `MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu)`
### MenuUpdateApplicationMenu
Updates the application menu, picking up any changes to the menu passed to `MenuSetApplicationMenu`.
Met à jour le menu de l'application, avec toutes les autres modifications déjà appliquées via `MenuSetApplicationMenu`.
Go: `MenuUpdateApplicationMenu(ctx context.Context)`

View File

@ -2,205 +2,205 @@
sidebar_position: 4
---
# Window
# Fenêtre
These methods give control of the application window.
Ces méthodes donnent le contrôle de la fenêtre de l'application.
### WindowSetTitle
Sets the text in the window title bar.
Définit le texte dans la barre de titre de la fenêtre.
Go: `WindowSetTitle(ctx context.Context, title string)`<br/> JS: `WindowSetTitle(title: string)`
### WindowFullscreen
Makes the window full screen.
Mets la fenêtre en plein écran.
Go: `WindowFullscreen(ctx context.Context)`<br/> JS: `WindowFullscreen()`
### WindowUnfullscreen
Restores the previous window dimensions and position prior to full screen.
Restaure les dimensions et la position de la fenêtre avant le plein écran.
Go: `WindowUnfullscreen(ctx context.Context)`<br/> JS: `WindowUnfullscreen()`
### WindowIsFullscreen
Returns true if the window is full screen.
Renvoie vrai si la fenêtre est en plein écran.
Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen() bool`
### WindowCenter
Centers the window on the monitor the window is currently on.
Centre la fenêtre sur le moniteur sur laquelle la fenêtre est actuellement ouverte.
Go: `WindowCenter(ctx context.Context)`<br/> JS: `WindowCenter()`
### WindowExecJS
Executes arbitrary JS code in the window.
Exécute du code JS dans la fenêtre.
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.
Cette méthode exécute le code dans le navigateur de manière asynchrone et retourne immédiatement le résultat. Si le script cause des erreurs, elles ne seront disponibles que dans la console du navigateur.
Go: `WindowExecJS(ctx context.Context, js string)`
### WindowReload
Performs a "reload" (Reloads current page).
Effectue un "rechargement" (Recharge la page courante).
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
### WindowReloadApp
Reloads the application frontend.
Recharge le frontend de l'application.
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
### WindowSetSystemDefaultTheme
Windows only.
Windows seulement.
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
Sets window theme to system default (dark/light).
Définit le thème de fenêtre à la valeur par défaut du système (sombre/clair).
### WindowSetLightTheme
Windows only.
Windows seulement.
Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
Sets window theme to light.
Définit le thème clair à la fenêtre.
### WindowSetDarkTheme
Windows only.
Windows seulement.
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
Sets window theme to dark.
Définit le thème sombre à la fenêtre.
### WindowShow
Shows the window, if it is currently hidden.
Affiche la fenêtre, si elle est actuellement masquée.
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
### WindowHide
Hides the window, if it is currently visible.
Masque la fenêtre, si elle est actuellement visible.
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
### WindowIsNormal
Returns true if the window not minimised, maximised or fullscreen.
Renvoie vrai si la fenêtre n'est pas minimisée, maximisée ou plein écran.
Go: `WindowIsNormal(ctx context.Context) bool`<br/> JS: `WindowIsNormal() bool`
### WindowSetSize
Sets the width and height of the window.
Définit la largeur et la hauteur de la fenêtre.
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
### WindowGetSize
Gets the width and height of the window.
Retourne la largeur et la hauteur de la fenêtre.
Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/> JS: `WindowGetSize() : Size`
### WindowSetMinSize
Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions.
Définit la taille minimale de la fenêtre. Redimensionnera la fenêtre si la fenêtre est actuellement plus petite que les dimensions données.
Setting a size of `0,0` will disable this constraint.
Définir une taille de `0,0` désactivera cette contrainte.
Go: `WindowSetMinSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMinSize(size: Size)`
### WindowSetMaxSize
Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions.
Définit la taille maximale de la fenêtre. Redimensionnera la fenêtre si la fenêtre est actuellement plus grande que les dimensions données.
Setting a size of `0,0` will disable this constraint.
Définir une taille de `0,0` désactivera cette contrainte.
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
### WindowSetAlwaysOnTop
Sets the window AlwaysOnTop or not on top.
Paramètre pour faire en sorte que la fenêtre soit toujours au dessus des autres ou non.
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
### WindowSetPosition
Sets the window position relative to the monitor the window is currently on.
Définit la position de la fenêtre par rapport au moniteur sur lequel la fenêtre est activée.
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
### WindowGetPosition
Gets the window position relative to the monitor the window is currently on.
Récupère la position de la fenêtre relative au moniteur sur lequel la fenêtre est activée.
Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetPosition() : Position`
### WindowMaximise
### WindowMaximiseWindowMaximise
Maximises the window to fill the screen.
Maximise la fenêtre pour remplir l'écran.
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
### WindowUnmaximise
Restores the window to the dimensions and position prior to maximising.
Restaure la fenêtre aux dimensions et à la position avant qu'elle soit maximisée.
Go: `WindowUnmaximise(ctx context.Context)`<br/> JS: `WindowUnmaximise()`
### WindowIsMaximised
Returns true if the window is maximised.
Renvoie vrai si la fenêtre est maximisée.
Go: `WindowIsMaximised(ctx context.Context) bool`<br/> JS: `WindowIsMaximised() bool`
### WindowToggleMaximise
Toggles between Maximised and UnMaximised.
Option permettant de basculer entre la maximisation de la fenêtre et sa non maximisation.
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
### WindowMinimise
Minimises the window.
Minimise la fenêtre.
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
### WindowUnminimise
Restores the window to the dimensions and position prior to minimising.
Restaure la fenêtre aux dimensions et à la position avant qu'elle soit minimisée.
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
### WindowIsMinimised
Returns true if the window is minimised.
Renvoie vrai si la fenêtre est minimisée.
Go: `WindowIsMinimised(ctx context.Context) bool`<br/> 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.
Définit la couleur de fond de la fenêtre avec la couleur RGBA donnée. Cette couleur sera visible au travers de tous les pixels transparents.
Valid values for R, G, B and A are 0-255.
Les valeurs valides pour R, G, B et A sont entre 0 et 255 inclus.
:::info Windows
On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255.
Sous Windows, seules les valeurs 0 et 255 sont prises en charge pour A. Toute valeur qui n'est pas 0 sera considérée comme 255.
:::
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
## Typescript Object Definitions
## TypeScript Object Definitions
### Position
@ -211,7 +211,7 @@ interface Position {
}
```
### Size
### Size (taille)
```ts
interface Size {

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.0.0-rc.1"
},
"sidebar.docs.category.Getting Started": {
"message": "Pour démarrer",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "Références",
"message": "Reference",
"description": "The label for category Reference in sidebar docs"
},
"sidebar.docs.category.Runtime": {
@ -16,11 +16,11 @@
"description": "The label for category Runtime in sidebar docs"
},
"sidebar.docs.category.Community": {
"message": "Communauté",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "Galerie",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
@ -28,11 +28,11 @@
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "Tutoriels",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "Contribuer",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.0.0"
},
"sidebar.docs.category.Getting Started": {
"message": "Pour démarrer",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "Références",
"message": "Reference",
"description": "The label for category Reference in sidebar docs"
},
"sidebar.docs.category.Runtime": {
@ -16,11 +16,11 @@
"description": "The label for category Runtime in sidebar docs"
},
"sidebar.docs.category.Community": {
"message": "Communauté",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "Galerie",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
@ -28,11 +28,11 @@
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "Tutoriels",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "Contribuer",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.1.0"
},
"sidebar.docs.category.Getting Started": {
"message": "Pour démarrer",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "Références",
"message": "Reference",
"description": "The label for category Reference in sidebar docs"
},
"sidebar.docs.category.Runtime": {
@ -16,11 +16,11 @@
"description": "The label for category Runtime in sidebar docs"
},
"sidebar.docs.category.Community": {
"message": "Communauté",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "Galerie",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
@ -28,11 +28,11 @@
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "Tutoriels",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "Contribuer",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.2.0"
},
"sidebar.docs.category.Getting Started": {
"message": "Pour démarrer",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "Références",
"message": "Reference",
"description": "The label for category Reference in sidebar docs"
},
"sidebar.docs.category.Runtime": {
@ -16,11 +16,11 @@
"description": "The label for category Runtime in sidebar docs"
},
"sidebar.docs.category.Community": {
"message": "Communauté",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "Galerie",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
@ -28,11 +28,11 @@
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "Tutoriels",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "Contribuer",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -17,10 +17,13 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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)
- L'[AssetServer](/docs/reference/options#assetserver) supporte à présent les range-requests si l' [Assets](/docs/reference/options/#assets-1) `fs.FS` importe `io.ReadSeeker`. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2091)
- Ajouter une nouvelle propriété `bindings` dans le fichier de configuration `wails.json`. Plus d'informations sur la nouvelle propriété peuvent être trouvées dans le [schéma](/schemas/config.v2.json) mis à jour. Les propriétés `prefix` et `suffix` vous permettent de contrôler le nom d'entité TypeScript généré dans le fichier `model.ts`. Ajouté par @OlegGulevskyy dans [PR](https://github.com/wailsapp/wails/pull/2101)
- La méthode `WindowSetAlwaysOnTop` est maintenant exposée dans l'exécutable JS. Fixé par @gotid dans la [PR](https://github.com/wailsapp/wails/pull/2128)
### Corrections
- Le booléen activant la fonctionnalité `noreload` n'était pas utilisable dans le mode développement de wails. Corrigé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2081)
- Le dossier `build/bin` se dupliquait lui-même lors de chaque chargement en mode `développement de wails`. Corrigé par @OlegGulevskyy dans cette [PR](https://github.com/wailsapp/wails/pull/2103)
- `le dossier build/bin` se dupliquait sur chaque rechargement en mode `wails dev`. Corrigé par @OlegGulevskyy dans cette [PR](https://github.com/wailsapp/wails/pull/2103)
- Empêcher une fine ligne blanche au bas d'une fenêtre sans cadre sous Windows. Correction par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2111)
## v2.2.0 - 2022-11-09
@ -34,12 +37,12 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Si `go.mod` n'est pas trouvé dans le même répertoire que `wails.json`, le cli va chercher les répertoires parents pour le trouver. Corrigé par @leaanthony dans cette [PR](https://github.com/wailsapp/wails/pull/2009)
- La sortie de couleur dans le CLI peut maintenant être désactivée en utilisant l'option `--nocolor`. Ceci est utile pour les pipelines CI/CD. Merci à @scottopell pour cette [PR](https://github.com/wailsapp/wails/pull/1947)
- Une définition de schéma JSON pour le fichier `wails.json` a été ajoutée. Les IDEs devraient maintenant fournir le code complet lors de l'édition de `wails.json`. Merci à @binyamin pour cette [PR](https://github.com/wailsapp/wails/pull/1864)
- Les méthodes `EventsOn*` retournent maintenant une fonction qui peut être appelée pour désenregistrer l'auditeur. Thanks to @joshbuddy for the [PR](https://github.com/wailsapp/wails/pull/1969)
- Les méthodes `EventsOn*` retournent maintenant une fonction qui peut être appelée pour désenregistrer l'auditeur. Merci à @joshbuddy pour la [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)
- 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. Merci à @stffabi pour cette [correction](https://github.com/wailsapp/wails/pull/2043)
### Changements
@ -67,12 +70,12 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### 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
- [Prise en charge du bouton Non par défaut dans les boîtes de dialogue Windows](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony dans https://github.com/wailsapp/wails/pull/1875
- Ajout de la possibilité de redimensionner la fenêtre sans cadre sur Linux - @Lyimmi dans https://github.com/wailsapp/wails/pull/1918
- [Ajout de la transparence de la fenêtre pour linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi dans https://github.com/wailsapp/wails/pull/1926
- [Ajout de la méthode WindowExecJS](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony dans https://github.com/wailsapp/wails/pull/1927
- [Ajout de support pour `Info.dev.plist` sur macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony dans https://github.com/wailsapp/wails/pull/1960
- [Ajout de ZoomFactor get/set et ajout des options Windows respectives](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye sur https://github.com/wailsapp/wails/pull/1463
### Corrections
@ -84,7 +87,7 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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
- 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
@ -479,7 +482,7 @@ Experimental: &options.Experimental{
- 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)
- 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)
@ -489,7 +492,7 @@ Experimental: &options.Experimental{
- 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)
- 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)

View File

@ -70,6 +70,7 @@ Le processus de correction des bugs est le suivant :
- 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`
- A test that can reproduce the bug
- 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/<ticket_number>_<ticket_title>`

View File

@ -4,7 +4,7 @@
"description": "Navbar item with label Sponsor"
},
"item.label.Docs": {
"message": "Documents",
"message": "Docs",
"description": "Navbar item with label Docs"
},
"item.label.Blog": {
@ -20,7 +20,7 @@
"description": "Navbar item with label About"
},
"item.label.FAQ": {
"message": "Foire aux questions",
"message": "FAQ",
"description": "Navbar item with label FAQ"
},
"item.label.Changelog": {

View File

@ -1,57 +1,57 @@
{
"homepage.Features.Title1": {
"message": "豊富な機能"
"message": "Feature Rich"
},
"homepage.Features.Description1": {
"message": "メニューやダイアログといったネイティブUI要素を使用して、クロスプラットフォームアプリを構築しましょう。"
},
"homepage.Features.Title2": {
"message": "使い慣れた技術"
"message": "Familiar"
},
"homepage.Features.Description2": {
"message": "すでにあなたが知っている技術で、素晴らしいアプリを構築できます。"
"message": "Use the technologies you already know to build amazing applications."
},
"homepage.Features.Title3": {
"message": "速い"
"message": "Fast"
},
"homepage.Features.Description3": {
"message": "Wails CLIを使用して、プロジェクトをすばやく生成、ビルド、およびパッケージ化できます。"
"message": "Quickly generate, build and package your projects using the Wails CLI."
},
"homepage.Tagline": {
"message": "Goで美しいクロスプラットフォームアプリを開発"
"message": "Build beautiful cross-platform applications using Go"
},
"homepage.ButtonText": {
"message": "はじめよう"
"message": "Get Started"
},
"homepage.LearnMoreButtonText": {
"message": "詳しく"
"message": "Learn More"
},
"theme.ErrorPageContent.title": {
"message": "ページがクラッシュしました。",
"message": "This page crashed.",
"description": "The title of the fallback page when the page crashed"
},
"theme.ErrorPageContent.tryAgain": {
"message": "再試行",
"message": "Try again",
"description": "The label of the button to try again when the page crashed"
},
"theme.NotFound.title": {
"message": "ページが見つかりません",
"message": "Page Not Found",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "リクエストされたページは見つかりませんでした。",
"message": "We could not find what you were looking for.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "リンク元のページの所有者に連絡し、このリンクが無効であることをお知らせください。",
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "閉じる",
"message": "Close",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.archive.title": {
"message": "アーカイブ",
"message": "Archive",
"description": "The page & hero title of the blog archive page"
},
"theme.blog.archive.description": {
@ -59,91 +59,91 @@
"description": "The page & hero description of the blog archive page"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "ページ上部へ戻る",
"message": "Scroll back to top",
"description": "The ARIA label for the back to top button"
},
"theme.blog.paginator.navAriaLabel": {
"message": "ブログ投稿一覧ページナビゲーション",
"message": "Blog list page navigation",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "より新しい投稿",
"message": "Newer Entries",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "より古い投稿",
"message": "Older Entries",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.readingTime.plurals": {
"message": "1分で読めます|{readingTime}分で読めます",
"message": "One min read|{readingTime} min read",
"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}\"の投稿をすべて読む",
"message": "Read more about {title}",
"description": "The ARIA label for the link to full blog posts from excerpts"
},
"theme.blog.post.readMore": {
"message": "すべて読む",
"message": "Read More",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "ブログ投稿ページナビゲーション",
"message": "Blog post page navigation",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "次の新しい投稿",
"message": "Newer Post",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "次の古い投稿",
"message": "Older Post",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "最近のブログ投稿のナビゲーション",
"message": "Blog recent posts navigation",
"description": "The ARIA label for recent posts in the blog sidebar"
},
"theme.blog.post.plurals": {
"message": "1件の投稿|{count}件の投稿",
"message": "One post|{count} posts",
"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}件の投稿",
"message": "{nPosts} tagged with \"{tagName}\"",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "すべてのタグを見る",
"message": "View All Tags",
"description": "The label of the link targeting the tag list page"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "コードをクリップボードにコピー",
"message": "Copy code to clipboard",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copied": {
"message": "コピーしました",
"message": "Copied",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copy": {
"message": "コピー",
"message": "Copy",
"description": "The copy button label on code blocks"
},
"theme.colorToggle.ariaLabel": {
"message": "ダークモード/ライトモードの切替 (現在は{mode}です)",
"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": "ダークモード",
"message": "dark mode",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "ライトモード",
"message": "light mode",
"description": "The name for the light color mode"
},
"theme.docs.DocCard.categoryDescription": {
"message": "{count}",
"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": "サイドバーを展開",
"message": "Expand sidebar",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
@ -151,19 +151,19 @@
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.paginator.navAriaLabel": {
"message": "ドキュメントページナビゲーション",
"message": "Docs pages navigation",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "前へ",
"message": "Previous",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "次へ",
"message": "Next",
"description": "The label used to navigate to the next doc"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "サイドバーを折りたたむ",
"message": "Collapse sidebar",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
@ -171,74 +171,74 @@
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "'{label}'カテゴリサイドバーの折りたたみを切替える",
"message": "Toggle the collapsible sidebar category '{label}'",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "1件のドキュメントがタグ付けされています|{count}件のドキュメントがタグ付けされています",
"message": "One doc tagged|{count} docs tagged",
"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}件のドキュメント",
"message": "{nDocsTagged} with \"{tagName}\"",
"description": "The title of the page for a docs tag"
},
"theme.docs.versionBadge.label": {
"message": "バージョン: {versionLabel}"
"message": "Version: {versionLabel}"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "これは、{siteTitle} {versionLabel}のまだ未公開なドキュメントです。",
"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}のドキュメントで、長期間更新されていません。",
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "最新のドキュメントは、{latestVersionLink} ({versionLabel}) をご覧ください。",
"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": "最新バージョン",
"message": "latest version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "このページを編集",
"message": "Edit this page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "見出しへの直リンク",
"message": "Direct link to heading",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": "{date}",
"message": " on {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": "{user}",
"message": " by {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "{byUser}が{atDate}に最終更新",
"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": "← メインメニューに戻る",
"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": "バージョン一覧",
"message": "Versions",
"description": "The label for the navbar versions dropdown on mobile view"
},
"theme.common.skipToMainContent": {
"message": "メインコンテンツにスキップ",
"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": "タグ:",
"message": "Tags:",
"description": "The label alongside a tag list"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "このページ",
"message": "On this page",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.navbar.mobileLanguageDropdown.label": {
@ -246,26 +246,26 @@
"description": "The label for the mobile language switcher dropdown"
},
"theme.SearchBar.seeAll": {
"message": "{count}件の結果をすべて見る"
"message": "See all {count} results"
},
"theme.SearchBar.label": {
"message": "検索",
"message": "Search",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "1件のドキュメントが見つかりました|{count}件のドキュメントが見つかりました",
"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": "\"{query}\"の検索結果",
"message": "Search results for \"{query}\"",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "ドキュメントの検索",
"message": "Search the documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "検索したい単語を入力",
"message": "Type your search here",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
@ -273,31 +273,31 @@
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Algoliaによる検索",
"message": "Search by Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "見つかりませんでした",
"message": "No results were found",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "新しい結果を取得中...",
"message": "Fetching new results...",
"description": "The paragraph for fetching new search results"
},
"theme.tags.tagsPageTitle": {
"message": "タグ",
"message": "Tags",
"description": "The title of the tag list page"
},
"theme.docs.breadcrumbs.home": {
"message": "ホームページ",
"message": "Home page",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "パンくずリスト",
"message": "Breadcrumbs",
"description": "The ARIA label for the breadcrumbs"
},
"theme.CodeBlock.wordWrapToggle": {
"message": "Toggle word wrap 文字列の折り返しの切替",
"message": "Toggle word wrap",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.admonition.note": {

View File

@ -116,7 +116,7 @@ It also provides the additional features:
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 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!

View File

@ -74,7 +74,7 @@ It also provides the additional features:
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 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!

View File

@ -61,7 +61,7 @@ It also provides the additional features:
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 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!

View File

@ -45,7 +45,7 @@ The v2 release is a huge leap forward for the project, addressing many of the pa
- 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).
- 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.

View File

@ -8,7 +8,7 @@
"description": "The description for the blog used in SEO"
},
"sidebar.title": {
"message": "最近の投稿",
"message": "Recent posts",
"description": "The label for the left sidebar"
}
}

View File

@ -1,6 +1,6 @@
{
"version.label": {
"message": "次のバージョン 🚧",
"message": "Next Version 🚧",
"description": "The label for version current"
},
"sidebar.docs.category.Getting Started": {

View File

@ -2,25 +2,25 @@
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.
Wailsに関する[最高のリンク一覧](https://github.com/wailsapp/awesome-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)
- [v2ベータディスカッションボード](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
- [Wails中国語コミュニティQQグループ](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - グループナンバー: 1067173054
## その他のチュートリアルや記事
- [掲示板を作ってみる](https://blog.customct.com/building-bulletin-board)

View File

@ -13,4 +13,4 @@ The FileHound Export Utility allows FileHound Administrators the ability to run
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
Frontend with: Vue 2.6.11 Vuex 3.4.0 TypeScript Tailwind 1.9.6

View File

@ -7,8 +7,8 @@ sidebar_position: 5
プロジェクトディレクトリのルート上で`wails dev`コマンドを実行すると、アプリを開発モードで起動することができます。 コマンドを実行すると下記の処理が実行されます:
- アプリをビルドしたのち、起動する
- Goのコードをフロントエンドにバインドし、Javascriptから呼び出せるようにする
- Using the power of [Vite](https://vitejs.dev/), will watch for modifications in your Go files and rebuild/re-run on change
- Goのコードをフロントエンドにバインドして、JavaScriptから呼び出せるようにする
- [Vite](https://vitejs.dev/)の機能を使用して、Goファイルの変更を監視し、変更された際には自動的にリビルド/再起動する
- ブラウザからアプリを操作できるようにする[Webサーバ](http://localhost:34115)を立ち上げる。 これにより、任意のブラウザ拡張機能を利用できる。 JavascriptのコンソールからGoのコードを呼び出すこともできる
アプリ開発を始めるときは、プロジェクトディレクトリ上で`wails dev`コマンドを実行しましょう。 詳しくは、[こちら](../reference/cli.mdx#dev)をご覧ください。

View File

@ -26,61 +26,61 @@ import TabItem from "@theme/TabItem";
]}
>
<TabItem value="Svelte">
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t svelte
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t svelte-ts
</TabItem>
<TabItem value="React">
Generate a <a href={"https://reactjs.org/"}>React</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://reactjs.org/"}>React</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t react
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t react-ts
</TabItem>
<TabItem value="Vue">
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t vue
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vue-ts
</TabItem>
<TabItem value="Preact">
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t preact
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t preact-ts
</TabItem>
<TabItem value="Lit">
Generate a <a href={"https://lit.dev/"}>Lit</a> project using Javascript with:<br/><br/>
Generate a <a href={"https://lit.dev/"}>Lit</a> project using JavaScript with:<br/><br/>
wails init -n myproject -t lit
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t lit-ts
</TabItem>
<TabItem value="Vanilla">
Generate a Vanilla project using Javascript with:<br/><br/>
Generate a Vanilla project using JavaScript with:<br/><br/>
wails init -n myproject -t vanilla
If you would rather use Typescript:<br/>
If you would rather use TypeScript:<br/>
wails init -n myproject -t vanilla-ts

View File

@ -84,6 +84,6 @@ go version
`wails doctor`を実行すると、必要な依存関係が正しくインストールされているかを確認することができます。 正しくインストールされていない場合は、その内容をあなたにお知らせして、どうすれば解決できるかを教えてくれます。
## `wails`コマンドが見つからないのですが?
## The `wails` command appears to be missing?
`wails`コマンドが見つからないとシステムに怒られた場合は、Goが、公式のGoインストール手順に従って導入されているかを確認してください。 コマンドが見つからないほとんどの理由は、あなたのホームディレクトリ配下にある`go/bin`ディレクトリのパスが、`PATH`環境変数に含まれていないからです。 また、インストールによって行われた環境変更を反映させるために、もともと開いていたコマンドプロンプト(ターミナル)がある場合はそれらをいったん閉じて、再度開きなおしてください。
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.

View File

@ -1,8 +1,8 @@
# 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では、フレームのないアプリケーションの作成をサポートしています。 [アプリケーションオプション](../reference/options.mdx#application-options)の[frameless](../reference/options.mdx#frameless)フィールドで設定することが可能です。
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.
Wailsでは、フレームレスウィンドウをドラッグできるようにするための簡単な仕組みを提供しています。`--wails-draggable:drag`というCSSスタイルをもつ任意のHTML要素は、"ドラッグハンドル"として機能します。 このプロパティは、すべての子要素にも継承されます。 ネストされている子要素で、ドラッグを明示的に無効化したい場合は、当該子要素で'--wails-draggable:no-drag'を指定します。
```html
<html>
@ -23,7 +23,7 @@ Wails offers a simple solution for dragging the window: Any HTML element that ha
</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:
一部のプロジェクトでは、動的なスタイリングが原因で、これらのCSSプロパティが使用できない場合があるでしょう。 そのような場合、アプリケーションオプションの`CSSDragProperty`および`CSSDragValue`を使用して、ドラッグ可能な領域を示すプロパティ名と値を独自に定義することができます。
```go title=main.go
package main
@ -40,10 +40,10 @@ import (
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,
@ -80,8 +80,8 @@ func main() {
</html>
```
:::info Fullscreen
:::info フルスクリーン
If you allow your application to go fullscreen, this drag functionality will be disabled.
アプリケーションをフルスクリーン状態にすると、このドラッグ機能は無効になります。
:::

View File

@ -38,7 +38,7 @@ To provide more flexibility to developers, there is a meta tag that may be used
The options are as follows:
| | Description |
| Value | Description |
| ------------------- | ------------------------------------------------ |
| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` |
| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` |

View File

@ -1,8 +1,8 @@
# IDEs
# 統合開発環境
Wails aims to provide a great development experience. To that aim, we now support generating IDE specific configuration to provide smoother project setup.
Wailsでは、優れた開発体験の提供を目指しています。 その一環として、統合開発環境特有の構成設定の生成をサポートしており、より快適にプロジェクトをセットアップできるようになっています。
Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but aim to support other IDEs such as Goland.
現在は[Visual Studio Code](https://code.visualstudio.com/)をサポートしていますが、今後、Golandなど他の統合開発環境もサポートしていく予定です。
## Visual Studio Code
@ -15,9 +15,9 @@ Currently, we support [Visual Studio Code](https://code.visualstudio.com/) but a
</p>
```
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.
プロジェクト生成時のコマンドに`-ide vscode`フラグを付与すると、統合開発環境用の構成ファイルが、他のプロジェクトファイルと共に作成されます。 これらのファイルは`.vscode`ディレクトリ内に配置され、アプリケーションをデバッグするための正しい構成設定が記述されています。
The 2 files generated are `tasks.json` and `launch.json`. Below are the files generated for the default vanilla project:
生成されるのは`tasks.json`ファイルおよび`launch.json`ファイルの2つです。 デフォルトのバニラプロジェクトの場合、次のような内容となります:
```json title="tasks.json"
{
@ -62,9 +62,9 @@ The 2 files generated are `tasks.json` and `launch.json`. Below are the files ge
}
```
### 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:
デフォルトのプロジェクトでは、`npm install`や`npm run build`などのステップが必要ないため、`tasks.json`ファイルの内容なシンプルなものになっています。 Svelteテンプレートのように、フロントエンドのビルドステップが必要なプロジェクトの場合、`tasks.json`を編集して、インストールおよびビルドのステップを追加する必要があります。
```json title="tasks.json"
{
@ -120,8 +120,8 @@ The `tasks.json` file is simple for the default project as there is no `npm inst
}
```
:::info Future Enhancement
今後の機能強化予定
In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically.
将来的に、インストールおよびビルドステップを含んだ`tasks.json`を自動生成できるように計画しています。
:::

View File

@ -96,8 +96,8 @@ type PackageManager interface {
Take a look at the other package managers code to get an idea how this works.
:::info Remember
:::info リマインド
If you add support for a new package manager, don't forget to also update this page!
新しいパッケージマネージャを追加した場合は、このページも忘れずに更新してください。
:::

View File

@ -118,7 +118,7 @@ The _biggest_ change in v2 is how assets are handled.
In v1, assets were passed via 2 application options:
- `JS` - The application's Javascript
- `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.

View File

@ -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:

View File

@ -353,22 +353,33 @@ jobs:
# 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.
- 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
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- name: Sign our macOS binary
if: matrix.platform == 'macos-latest'
run: |
brew install mitchellh/gon/gon
- name: Import Code-Signing Certificates for macOS
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: Apple-Actions/import-codesign-certs@v1
uses: actions/upload-artifact@v2
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.
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

View File

@ -1,4 +1,4 @@
# テンプレート
# 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:

View File

@ -105,9 +105,9 @@ 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
## 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).
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

View File

@ -4,7 +4,7 @@ sidebar_position: 20
# どうやって動いているの?
Wailsは、webkitフロントエンドを備えた、何の変哲もないGoアプリです。 アプリ全体のうちGoの部分は、アプリのコードと、ウィンドウ制御などの便利な機能を提供するランタイムライブラリで構成されています。 フロントエンドはwebkitウィンドウであり、フロンドエンドアセットをウィンドウ上に表示します。 フロントエンドからも、Javascriptでランタイムライブラリを呼び出すことができます。 そして最終的に、Goのメソッドはフロントエンドにバインドされ、ローカルのJavascriptメソッドであるかのように、フロントエンドから呼び出すことができます。
Wailsは、webkitフロントエンドを備えた、何の変哲もないGoアプリです。 アプリ全体のうちGoの部分は、アプリのコードと、ウィンドウ制御などの便利な機能を提供するランタイムライブラリで構成されています。 フロントエンドはwebkitウィンドウであり、フロンドエンドアセットをウィンドウ上に表示します。 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
<div className="text--center">
@ -14,7 +14,7 @@ Wailsは、webkitフロントエンドを備えた、何の変哲もないGoア
## アプリのメインコード
### Overview
### 概要
アプリは、`wails.Run()`メソッドを1回呼び出すことで、構成することができます。 このメソッドで、アプリのウィンドウサイズやウィンドウタイトル、使用アセットなどを指定することができます。 基本的なアプリを作るコードは次のとおりです:
@ -84,7 +84,7 @@ func (b *App) Greet(name string) string {
設定可能なすべてのオプションについては、[オプションのリファレンス](reference/options)をご覧ください。
#### Assets
#### アセット
Wailsでフロントエンドアセット無しのアプリを作成することはできないため、`Assets`オプションは必須オプションです。 アセットには、一般的なWebアプリケーションでよく見かけるような、html、js、css、svg、pngなどのファイルを含めることができます。**アセットバンドルを生成する必要は一切なく**、そのままのファイルを使用できます。 アプリが起動すると、アセット内の`index.html`が読み込まれます。この時点で、フロントエンドはブラウザとして動作するようになります。 `embed.FS`を使ってアセットファイルが格納されたディレクトリを指定しますが、ディレクトリの場所はどこでも構いません。 embedで指定するパスは、`frontend/dist`のように、アプリのメインコードから相対的に見たディレクトリパスになります:
@ -103,13 +103,13 @@ var assets embed.FS
#### アプリのライフサイクル
フロントエンドが`index.html`を読み込もうとする直前に、[OnStartup](reference/options.mdx#onstartup)で指定されたメソッドがコールバックされます。 A standard Go context is passed to this method. このメソッドに引数で渡されるContextは、今後、Wailsのラインタイムを呼び出すときに必要になるため、通常は、このContextへの参照を保持しておいてください。 同様に、アプリがシャットダウンされる直前には、[OnShutdown](reference/options.mdx#onshutdown)で指定されたコールバックが呼び出され、Contextも渡されます。 `index.html`に含まれるすべてのアセットが読み込み終わったときに呼び出される[OnDomReady](reference/options.mdx#ondomready)コールバックもあります。これは、Javascriptの[`body onload`](https://www.w3schools.com/jsref/event_onload.asp)イベントと同等のものです。 また、[OnBeforeClose](reference/options.mdx#onbeforeclose)を指定すると、ウィンドウを閉じる(またはアプリを終了する)イベントにフックさせることもできます。
フロントエンドが`index.html`を読み込もうとする直前に、[OnStartup](reference/options.mdx#onstartup)で指定されたメソッドがコールバックされます。 A standard Go context is passed to this method. このメソッドに引数で渡されるContextは、今後、Wailsのラインタイムを呼び出すときに必要になるため、通常は、このContextへの参照を保持しておいてください。 同様に、アプリがシャットダウンされる直前には、[OnShutdown](reference/options.mdx#onshutdown)で指定されたコールバックが呼び出され、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. また、[OnBeforeClose](reference/options.mdx#onbeforeclose)を指定すると、ウィンドウを閉じる(またはアプリを終了する)イベントにフックさせることもできます。
#### メソッドのバインド
`Bind`オプションは、Wailsアプリで最も重要なオプションの1つです。 このオプションでは、フロントエンドに公開する、構造体のメソッドを指定することができます。 構造体は、従来のWebアプリにおける"コントローラ"の立ち位置であるとお考えください。 アプリが起動すると、`Bind`オプションで指定されている構造体を対象に、その中にあるパブリックメソッド(大文字で始まるメソッド名)を探します。そして、フロントエンドのコードからそれらのメソッドを呼び出せるJavascriptが生成されます。
`Bind`オプションは、Wailsアプリで最も重要なオプションの1つです。 このオプションでは、フロントエンドに公開する、構造体のメソッドを指定することができます。 構造体は、従来のWebアプリにおける"コントローラ"の立ち位置であるとお考えください。 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 備考
:::info Note
Wailsで構造体を正しくバインドするためには、構造体の*インスタンス*をオプションで指定してください。
@ -184,15 +184,15 @@ func (a *App) Greet(name string) string {
`wails dev`コマンド(または、`wails generate module`コマンド)を実行すると、以下のものを含むフロントエンドモジュールが生成されます:
- バインドされたすべてのメソッドのJavascript
- バインドされたすべてのメソッドのTypescript宣言
- バインドされたメソッドの引数または返り値で使用されているGoの構造体のTypescript宣言
- 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
これにより、強力な型付けがなされたデータ構造を使用して、フロントエンドから簡単にGoのコードを呼び出すことができます。
## フロントエンド
### Overview
### 概要
フロントエンドは、webkitによってレンダリングされるファイル群です。 ブラウザとWebサーバが一体となったような動きをします。 使用できるフレームワークやライブラリの制限はほぼありません[^1]。 フロントエンドとGoコードとの相互のやり取りについて、主なポイントは次のとおりです:
@ -201,7 +201,7 @@ func (a *App) Greet(name string) string {
### バインドされたGoメソッドの呼び出し
`wails dev`コマンドでアプリを起動すると、Go構造体のJavascriptバインディングが`wailsjs/go`ディレクトリに自動的に生成されます(`wails generate module`コマンドでも生成可能)。 生成されたファイルには、アプリ内のGoパッケージ名が反映されています。 先の例では、`Greet`というパブリックメソッドを持つ`app`をバインドしていました。 この場合、次のようなファイルが生成されることになります:
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`). 生成されたファイルには、アプリ内のGoパッケージ名が反映されています。 先の例では、`Greet`というパブリックメソッドを持つ`app`をバインドしていました。 この場合、次のようなファイルが生成されることになります:
```bash
wailsjs
@ -211,7 +211,7 @@ wailsjs
└─App.js
```
ご覧のとおり、`main`パッケージ内の`App`構造体Javascriptバインディングが、それらのメソッドのTypescript型定義と並んで生成されていることが分かります。 フロントエンドから`Greet`メソッドを呼び出すには、単純にメソッドをインポートし、通常のJavascript関数と同じように呼び出してください:
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
// ...
@ -224,27 +224,27 @@ import {Greet} from '../wailsjs/go/main/App'
}
```
Typescript型定義ファイルは、バインドされたメソッドの正しい型を提供します:
The TypeScript declaration file gives you the correct types for the bound methods:
```ts
export function Greet(arg1: string): Promise<string>;
```
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 先の例では、`Greet`メソッドは`string`型の返り値のみであるため、無効なデータが渡されない限り、Javascript側でrejectハンドラが呼ばれることはありません。
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 In the example above, `Greet` only returns a `string` so the JavaScript call will never reject - unless invalid data is passed to it.
すべてのデータ型は、GoとJavascriptの間で正しく解釈されます。 もちろん構造体も正しく解釈されます。 Goから構造体が返された場合、フロントエンドにはJavascriptのクラスとして返されます。
All data types are correctly translated between Go and JavaScript. もちろん構造体も正しく解釈されます。 If you return a struct from a Go call, it will be returned to your frontend as a JavaScript class.
:::info 備考
:::info Note
Struct fields *must* have a valid `json` tag to be included in the generated Typescript.
Struct fields *must* have a valid `json` tag to be included in the generated TypeScript.
Anonymous nested structs are not supported at this time.
ネストされた匿名構造体(無名構造体) は、現時点ではサポートされていません。
:::
Goに対して引数として構造体を渡すこともできます。 構造体として取り扱ってほしいJavascriptのマップやクラスを渡すと、構造体に変換されます。 あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 このモジュールを使用すると、Javascriptネイティブなオブジェクトを構築し、Goコードへ送信することができます。
Goに対して引数として構造体を渡すこともできます。 Any JavaScript map/class passed as an argument that is expecting a struct, will be converted to that struct type. あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 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. バインドされたメソッドで、引数または返り値として指定されているすべてのGo構造体は、Goのコードラッパーモジュールの一部として生成されたTypescript定義を持っています。 これらを使用することで、GoとJavascriptの間で、同じデータモデルを共有できます。
また、シグネチャに構造体を使用するGoメソッドもサポートされています。 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.
例: `Greet`メソッドを更新して、文字列型の代わりに`Person`型を引数で受け付けてみる:
@ -358,7 +358,7 @@ function generate() {
### ランタイムメソッドの呼び出し
Javascriptランタイムは`window.runtime`に存在し、イベント発行やロギングなど、さまざまなタスクを実行するためのメソッドが含まれています:
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);

View File

@ -8,16 +8,16 @@ Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの
"Goの力によって、Electronが軽量かつ高速になったようなもの"、と考えるとよいでしょう。 Goの柔軟性とパワーに、リッチでモダンなフロントエンドを組み合わせたアプリを、簡単に構築することができます。
### 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
- ネイティブなメニュー、ダイアログ、テーマ、透過処理を使用可能です
- Windows、macOS、Linuxをサポートしています
- Svelte、React、Preact、Vue、Lit、バニラJS向けにビルトインテンプレートを用意しています
- Easily call Go methods from JavaScript
- Automatic Go struct to TypeScript model generation
- WindowsにおいてCGOや外部DLLは必要ありません
- [Vite](https://vitejs.dev/)の力を利用したライブ開発が可能です
- Powerful CLI to easily Create, Build and Package applications
- アプリケーションを簡単に作成、ビルド、パッケージングするための強力なCLIを備えています
- 豊富な[ランタイムライブラリ](/docs/reference/runtime/intro)を用意しています
- Wailsで構築されたアプリケーションは、Apple StoreおよびMicrosoft Storeに準拠しています
@ -36,7 +36,7 @@ Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの
### クイックスタートテンプレート
Wailsには、アプリの開発をすばやく始められるように、多数のテンプレートが用意されています。 Svelte、React、Vue、Preact、LitおよびVanilla用で、それぞれのテンプレートがあります。 各テンプレートには、Javascript版とTypescript版が用意されています。
Wailsには、アプリの開発をすばやく始められるように、多数のテンプレートが用意されています。 Svelte、React、Vue、Preact、LitおよびVanilla用で、それぞれのテンプレートがあります。 There are both JavaScript and TypeScript versions for each template.
### ネイティブ要素
@ -44,13 +44,13 @@ Wailsは、ウィンドウ、メニュー、ダイアログなどのネイティ
**ブラウザを埋め込まないため**、無駄なリソースを割きません。 ブラウザを埋め込まない代わりに、OSプラットフォームのネイティブなレンダリングエンジンを使用します。 例えばWindowsの場合、Chromium上でビルトされているMicrosoft Webview2ライブラリを使用します。
### GoとJavascriptのやり取り
### Go & JavaScript Interoperability
Wailsは自動的に、GoのメソッドをJavascriptから利用できるようにするので、フロントエンドからGoのメソッド名を呼び出すことができます。 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.
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.
### ランタイムライブラリ
WailsはGoとJavascriptの両方にランタイムライブラリを提供し、イベント、ロギング、ダイアログなど、モダンなアプリに必要な多くの機能を使うことができます。
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.
### ライブ開発
@ -64,7 +64,7 @@ WailsはGoとJavascriptの両方にランタイムライブラリを提供し、
#### ブラウザを使った開発
If you prefer to debug and develop in a browser then Wails has you covered. ブラウザでのデバッグや開発も、Wailsにお任せください。 起動中のアプリはWebサーバを兼ねており、お好きなブラウザから接続してアプリを操作することができます。 プログラムアセットが書き換わった時はすぐに更新されます。
ブラウザでのデバッグや開発も、Wailsにお任せください。 起動中のアプリはWebサーバを兼ねており、お好きなブラウザから接続してアプリを操作することができます。 プログラムアセットが書き換わった時はすぐに更新されます。
### 本番用のネイティブバイナリ

View File

@ -4,77 +4,77 @@ 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のCLIには、プロジェクトの管理に使用できるコマンドが多数あります。 すべてのコマンドは次の文法で実行できます:
`wails <command> <flags>`
`wails <コマンド> <フラグ>`
## init
`wails init` is used for generating projects.
`wails init`はプロジェクトの生成に使用します。
| 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 |
| フラグ | Description | デフォルト |
|:----------------- |:----------------------------------------------------------------------------- |:-------:|
| -n "プロジェクト名" | プロジェクトの名前。 **必須項目**。 | |
| -d "プロジェクトディレクトリ" | 作成するプロジェクトディレクトリ | プロジェクト名 |
| -g | gitリポジトリを初期化する | |
| -l | 利用可能なプロジェクトテンプレート一覧を表示 | |
| -q | コンソールへの出力を抑止 | |
| -t "テンプレート名" | 使用するプロジェクトテンプレート。 ここで指定する値は、デフォルトテンプレート名、または、GitHubでホストされているリモートテンプレートのURLです。 | vanilla |
| -ide | IDEプロジェクトファイルを生成 | |
| -f | アプリケーションを強制的にビルド | false |
例: `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.
この例では、サイレントモードで、"mytestproject"ディレクトリに"test"という名前のプロジェクトが生成されるとともに、gitの初期化、vscodeプロジェクトファイルの生成が行われます。
More information on using IDEs with Wails can be found [here](../guides/ides.mdx).
WailsでIDEを使用する場合の詳細については、[こちら](../guides/ides.mdx)をご覧ください。
### Remote Templates
### リモートテンプレート
Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL.
WailsではGitHubでホストされているリモートテンプレートをサポートしており、テンプレートのプロジェクトURLを使用してインストールできます。
例: `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)
コミュニティがメンテナンスしているテンプレートの一覧は[こちら](../community/templates.mdx)をご覧ください。
:::warning 注意
:::warning Attention
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!**
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
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.
`wails build`は、プロジェクトを本番配布用のバイナリにコンパイルするときに使用します。
| 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`.<br/>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" | Goコンパイラに渡すビルドタグ。 値は引用符で囲んでください。 また、スペースまたはカンマで区切ってください(両方は使用しないでください)。 | |
| -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 | [garble](https://github.com/burrowers/garble)を使用してアプリケーションを難読化する | false |
| -garbleargs | garbleへ渡す引数 | `-literals -tiny -seed=random` |
| フラグ | Description | デフォルト |
|:-------------------- |:-------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- |
| -platform | 指定された[プラットフォーム](../reference/cli.mdx#platforms)(カンマ区切り) 向けにビルドする。例: `windows/arm64`。 アーキテクチャを指定しない場合は、`runtime.GOARCH`の値が使用されます。 | platform = `GOOS` environment variable if given else `runtime.GOOS`.<br/>arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. |
| -clean | `build/bin`ディレクトリをクリーンする | |
| -compiler "compiler" | 違うGoコンパイラを使用する。例: go1.15beta1 | go |
| -ldflags "flags" | コンパイラに渡す追加のldflags | |
| -nopackage | アプリケーションをパッケージ化しない | |
| -o filename | 出力ファイル名 | |
| -s | フロントエンドのビルドをスキップ | false |
| -f | アプリケーションを強制的にビルド | false |
| -tags "extra tags" | Goコンパイラに渡すビルドタグ。 値は引用符で囲んでください。 また、スペースまたはカンマで区切ってください(両方は使用しないでください)。 | |
| -upx | "upx"を使用して最終的にバイナリを圧縮する | |
| -upxflags | upxに渡すフラグ | |
| -v int | 詳細度レベル (0 - サイレント, 1 - デフォルト, 2 - 詳細) | 1 |
| -webview2 | WebView2インストーラーのストラテジ: download,embed,browser,error | download |
| -u | プロジェクトの`go.mod`を更新し、CLIと同じバージョンのWailsを使用する | |
| -debug | アプリケーションのデバッグ情報を保持する。 これにより、アプリケーションウィンドウで開発者ツールを使用することを許可できます。 | false |
| -trimpath | 実行可能ファイルから、すべてのファイルシステムパスを削除する | false |
| -race | Goのrace detectorを使用してビルドする | false |
| -windowsconsole | Windiws向けビルドでコンソールウィンドウを維持する | |
| -obfuscate | [garble](https://github.com/burrowers/garble)を使用してアプリケーションを難読化する | false |
| -garbleargs | garbleへ渡す引数 | `-literals -tiny -seed=random` |
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
`webview2`フラグの詳細については、[Windows](../guides/windows.mdx)ガイドをご覧ください。
If you prefer to build using standard Go tooling, please consult the [Manual Builds](../guides/manual-builds.mdx) guide.
標準のGoツールを使用してビルドしたい場合は、[手動ビルド](../guides/manual-builds.mdx)ガイドをご覧ください。
Example:
@ -84,38 +84,38 @@ Example:
Macでは、アプリケーションは`Info.dev.plist`ではなく`Info.plist`でバンドルされます。
:::
:::info UPX on Apple Silicon
:::info AppleシリコンでのUPX
There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon.
AppleシリコンにおけるUPXの使用には[既知の問題](https://github.com/upx/upx/issues/446)が確認されています。
:::
:::info UPX on Windows
:::info WindowsでのUPX
Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437).
いくつかのアンチウイルスソフトでは、`upx`で圧縮されたバイナリをウイルスとして検知することが確認されています。詳しくは、[upxの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 |
| プラットフォーム | Description |
|:---------------- |:-------------------------------- |
| darwin | MacOS + ビルドマシンのアーキテクチャ |
| darwin/amd64 | MacOS 10.13+ AMD64 |
| darwin/arm64 | MacOS 11.0+ ARM64 |
| darwin/universal | MacOS AMD64+ARM64 ユニバーサルアプリケーション |
| windows | Windows 10/11 + ビルドマシンのアーキテクチャ |
| windows/amd64 | Windows 10/11 AMD64 |
| windows/arm64 | Windows 10/11 ARM64 |
| linux | Linux + ビルドマシンのアーキテクチャ |
| linux/amd64 | Linux AMD64 |
| linux/arm64 | Linux ARM64 |
## doctor
`wails doctor` will run diagnostics to ensure that your system is ready for development.
`wails doctor`は、あなたのコンピュータで開発の準備が整っているかを診断します。
Example:
@ -149,81 +149,81 @@ Your system is ready for Wails development!
## dev
`wails dev` is used to run your application in a "live development" mode. This means:
`wails dev`は、アプリケーションを"ライブ開発"モードで実行させたいときに使用します。 このコマンドにより、次のことが行われます:
- 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
- アプリケーションの`go.mod`が、CLIと同じバージョンのWailsを使用するように更新されます
- アプリケーションがコンパイルされた後、自動的に実行されます
- ウォッチャーが起動し、Goファイルの変更を検出した際には、アプリがリビルドされます
- `http://localhost:34115`でWebサーバが起動し、HTTP経由でアプリケーション(フロントエンドだけではありません)が提供されます。 これにより、任意のブラウザ拡張機能を使用することができます
- すべてのアプリケーションアセットはディスクから読み込まれます。 アセットが変更された場合、アプリケーションは自動的に、リビルドではなくリロードされます。 接続されているすべてのブラウザもリロードされます
- 以下を提供するJSモジュールが生成されます:
- JavaScript wrappers of your Go methods with autogenerated JSDoc, providing code hinting
- インスタンス生成したりGoメソッドに渡すことのできる、Go構造体のTypeScriptバージョン
- ランタイム用のラッパーおよびTypeScript型定義を含むJSモジュールも生成されます
- MacOSでは、アプリケーションを`.app`ファイルにバンドルして実行されます。 開発向けに、`build/darwin/Info.dev.plist`が使用されます。
| 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 | デバッグ |
| -noreload | Disable automatic reload when assets change | |
| -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` |
| -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 |
| フラグ | Description | デフォルト |
|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------- |:--------------------- |
| -assetdir "./path/to/assets" | 通常のアセットFSを使用する代わりに、指定されたディレクトリからアセットを提供する | `wails.json`で指定されている値 |
| -browser | 起動時にブラウザで`http://localhost:34115`を開く | |
| -compiler "compiler" | 違うGoコンパイラを使用する。例: go1.15beta1 | go |
| -e | リビルドをトリガーする拡張子 (カンマ区切り) | go |
| -reloaddirs | リロードをトリガーする追加ディレクトリ (カンマ区切り) | `wails.json`で指定されている値 |
| -ldflags "flags" | コンパイラに渡す追加のldflags | |
| -tags "extra tags" | コンパイラへ渡すビルドタグ (引用符およびスペース区切り) | |
| -loglevel "loglevel" | 使用するログレベル - Trace, Debug, Info, Warning, Error | Debug |
| -noreload | アセットが変更されたときの自動リロードを無効にする | |
| -nocolour | CLIのカラー出力を無効にする | false |
| -nogen | モジュールの生成を無効にする | |
| -v | 詳細度レベル (0 - サイレント, 1 - デフォルト, 2 - 詳細) | 1 |
| -wailsjsdir | 生成されたWailsのJSモジュールを格納するディレクトリ | `wails.json`で指定されている値 |
| -debounce | アセットの変更が検出されたあと、リロードするまでの時間 | 100 (ミリ秒) |
| -devserver "host:port" | Wails開発サーバをバインドするアドレス | "localhost:34115" |
| -frontenddevserverurl "url" | アセットを提供するサードパーティ製の開発サーバ(例: Vite) を使用する | "" |
| -appargs "args" | シェル形式でアプリケーションに渡される引数 | |
| -save | 指定された`assetdir`、`reloaddirs`、`wailsjsdir`、`debounce`、`devserver`、`frontenddevserverurl`フラグの値を、`wails.json`へ保存し、次回以降のデフォルト値にする | |
| -race | Goのrace detectorを使用してビルドする | false |
| -s | フロントエンドのビルドをスキップ | 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
- アプリケーションをビルドして実行する (詳しくは[こちら](../guides/manual-builds.mdx)をご覧ください)
- WailsのJSモジュールを`./frontend/src`ディレクトリ内に生成する
- `./frontend/dist`ディレクトリ内のファイルの更新を監視し、変更されたときにリロードする
- ブラウザを開き、アプリケーションへ接続する
There is more information on using this feature with existing framework scripts [here](../guides/application-development.mdx#live-reloading).
既存のフレームワークスクリプトで本機能を使用する方法について詳しくは[こちら](../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.
Wailsは、プロジェクトの生成に必ずテンプレートを使用します。 `wails generate template`コマンドは、プロジェクト生成時に使用できるテンプレートの作成を支援します。
| Flag | Description |
|:---------------- |:------------------------------------------- |
| -name | The template name (Mandatory) |
| -frontend "path" | Path to frontend project to use in template |
| フラグ | Description |
|:---------------- |:---------------------------- |
| -name | テンプレート名 (必須項目) |
| -frontend "path" | テンプレートで使用するフロントエンドプロジェクトへのパス |
For more details on creating templates, consult the [Templates guide](../guides/templates.mdx).
テンプレートの作成について詳しくは、[テンプレートガイド](../guides/templates.mdx)をご覧ください。
### module
The `wails generate module` command allows you to manually generate the `wailsjs` directory for your application.
`wails generate module`コマンドを使用すると、アプリケーションの`wailsjs`ディレクトリを手動で生成できます。
## update
`wails update` will update the version of the Wails CLI.
`wails update`コマンドを実行すると、Wails CLIのバージョンをアップデートできます。
| Flag | Description |
|:------------------ |:------------------------------------- |
| -pre | Update to latest pre-release version |
| -version "version" | Install a specific version of the CLI |
| フラグ | Description |
|:------------------ |:----------------------- |
| -pre | 最新のプレリリースバージョンにアップデートする |
| -version "version" | 特定のバージョンのCLIをインストールする |
## version
`wails version` will simply output the current CLI version.
`wails version`は、現在のCLIバージョンを出力するだけのコマンドです。

View File

@ -76,7 +76,7 @@ type MenuItem struct {
}
```
| Field | Type | Notes |
| フィールド | Type | Notes |
| ----------- | ------------------------------------ | ------------------------------------------------------------- |
| Label | string | The menu text |
| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item |
@ -221,7 +221,7 @@ 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:
| ロール | 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()` |

View File

@ -4,9 +4,9 @@ sidebar_position: 3
# オプション
## Application Options
## アプリケーションオプション
The `Options.App` struct contains the application configuration. It is passed to the `wails.Run()` method:
`Options.App`構造体には、アプリケーションの構成設定が含まれています。 これを`wails.Run()`メソッドに渡してください:
```go title="Example"
import (
@ -115,25 +115,25 @@ func main() {
### Title
The text shown in the window's title bar.
ウィンドウのタイトルバーに表示されるテキストです。
名前: Title<br/> データ型: `string`
### Width
The initial width of the window.
ウィンドウの初期幅です。
名前: Width<br/> データ型: `int`<br/> デフォルト値: 1024
### Height
The initial height of the window.
ウィンドウの初期の高さです。
名前: Height<br/> データ型: `int`<br/> デフォルト値: 768
### DisableResize
By default, the main window is resizable. Setting this to `true` will keep it a fixed size.
デフォルトでは、メインウィンドウのサイズは自在に変更することができます。 この設定を`true`にすると、サイズが固定されます。
名前: DisableResize<br/> データ型: `bool`
@ -143,7 +143,7 @@ By default, the main window is resizable. Setting this to `true` will keep it a
### WindowStartState
Defines how the window should present itself at startup.
起動時にウィンドウをどのように表示させるかを定義します。
| 値 | Win | Mac | Lin |
| ---------- | --- | --- | --- |
@ -155,43 +155,43 @@ Defines how the window should present itself at startup.
### Frameless
When set to `true`, the window will have no borders or title bar. Also see [Frameless Windows](../guides/frameless.mdx).
この設定を`true`にすると、ウィンドウに境界線やタイトルバーが表示されなくなります。 詳しくは[フレームレスウィンドウ](../guides/frameless.mdx)をご覧ください。
名前: Frameless<br/> データ型: `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.
ウィンドウの最小幅を設定します。 `Width`の値がこの値より小さい場合、ウィンドウ幅はデフォルトで`MinWidth`の値となります。
名前: MinWidth<br/> データ型: `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.
ウィンドウの最小の高さを設定します。 `Height`の値がこの値より小さい場合、ウィンドウの高さはデフォルトで`MinHeight`の値となります。
名前: MinHeight<br/> データ型: `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.
ウィンドウの最大幅を設定します。 `Width`の値がこの値より大きい場合、ウィンドウ幅はデフォルトで`MaxWidth`の値となります。
名前: MaxWidth<br/> データ型: `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.
ウィンドウの最大の高さを設定します。 `Height`の値がこの値より大きい場合、ウィンドウの高さはデフォルトで`MaxHeight`の値となります。
名前: MaxHeight<br/> データ型: `int`
### StartHidden
When set to `true`, the application will be hidden until [WindowShow](../reference/runtime/window.mdx#windowshow) is called.
`true`に設定すると、アプリケーションは[WindowShow](../reference/runtime/window.mdx#windowshow)が呼び出されるまで非表示となります。
名前: StartHidden<br/> データ型: `bool`
### HideWindowOnClose
By default, closing the window will close the application. この設定を`true`にすると、ウィンドウを閉じる操作をした際に、
デフォルトでは、ウィンドウを閉じるとアプリケーションが終了します。 この設定を`true`にすると、ウィンドウを閉じる操作をした際に、
ウィンドウが非表示の状態になります。
@ -199,13 +199,13 @@ By default, closing the window will close the application. この設定を`true`
### BackgroundColour
This value is the default background colour of the window. 例: options.NewRGBA(255,0,0,128) - 50%透過された赤色
ウィンドウのデフォルトの背景色です。 例: options.NewRGBA(255,0,0,128) - 50%透過された赤色
名前: BackgroundColour<br/> データ型: `*options.RGBA`<br/> デフォルト値: white
### AlwaysOnTop
Indicates that the window should stay above other windows when losing focus.
ウィンドウへのフォーカスが無くなっても、他ウィンドウより手前側にウィンドウを表示させるかを設定します。
名前: AlwaysOnTop<br/> データ型: `bool`
@ -239,7 +239,7 @@ AssetServerの固有オプションを定義します。 静的なアセット
| 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.
注意: 現在、LinuxはWebKit2GTKバージョン2.36.0未満をターゲットにしているため、使用できる機能が非常に限られています。 将来的に、WebKit2GTK 2.36.0以降の導入を予定しており、それによりいくつかの機能が新たにサポートされる予定です。
名前: AssetServer<br/> データ型: `*assetserver.Options`
@ -262,7 +262,7 @@ nilがセットされている場合、GETリクエストに常に[Handler](#han
- 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.
注意: フロントエンド側の開発サーバと組み合わせて使用すると、一部制限がかかる場合があります。 Viteは、拡張子を含まないパスに対して、常にindex.htmlを返します。
名前: AssetsHandler<br/> データ型: `http.Handler`
@ -276,7 +276,7 @@ Middlewareが定義されていない場合、デフォルトのAssetServerの
### Menu
The menu to be used by the application. More details about Menus in the [Menu Reference](../reference/runtime/menu.mdx).
アプリケーションで使用されるメニューです。 メニューについて詳しくは、[メニューのリファレンス](../reference/runtime/menu.mdx)をご覧ください。
:::note
@ -288,45 +288,45 @@ Macでは、メニューが指定されていない場合、デフォルトメ
### Logger
The logger to be used by the application. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
アプリケーションで使用するロガーです。 ロギングについて詳しくは、[ログのリファレンス](../reference/runtime/log.mdx)をご覧ください。
名前: Logger<br/> データ型: `logger.Logger`<br/> デフォルト値: 標準出力へのロガー
### LogLevel
The default log level. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
デフォルトのログレベルです。 ロギングについて詳しくは、[ログのリファレンス](../reference/runtime/log.mdx)をご覧ください。
名前: LogLevel<br/> データ型: `logger.LogLevel`<br/> デフォルト値: 開発モードの場合は`Info`、本番モードの場合は`Error`
### LogLevelProduction
The default log level for production builds. More details about logging in the [Log Reference](../reference/runtime/log.mdx).
本番ビルド時のデフォルトのログレベルです。 ロギングについて詳しくは、[ログのリファレンス](../reference/runtime/log.mdx)をご覧ください。
名前: LogLevelProduction<br/> データ型: `logger.LogLevel`<br/> デフォルト値: `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.
フロントエンド作成後、`index.html`が読み込まれる前に呼び出されるコールバックです。 アプリケーションのcontextが渡されます。
名前: OnStartup<br/> データ型: `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.
フロントエンドが`index.html`とそのリソースを読み込んだ後に呼び出されるコールバックです。 アプリケーションのcontextが渡されます。
名前: OnDomReady<br/> データ型: `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.
フロントエンドが破棄され、アプリケーションが終了する直前に呼び出されるコールバックです。 アプリケーションのcontextが渡されます。
名前: OnShutdown<br/> データ型: `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.
ウィンドウの閉じるボタンをクリックするか、`runtime.Quit`が呼ばれて、アプリケーションが終了されそうになっているときに呼び出されるコールバックです。 trueを返すとアプリケーションはそのまま維持され、falseを返すと通常どおりシャットダウンされます。 ユーザに対してプログラムの終了を確認したいときは、このコールバックを使うのが良いでしょう。
Example:
:
```go title=windowsapp.go
func (b *App) beforeClose(ctx context.Context) (prevent bool) {
@ -371,7 +371,7 @@ WebView2の拡大率を定義します。 これは、Edgeのユーザによる
### Bind
A slice of struct instances defining methods that need to be bound to the frontend.
フロントエンドにバインドする必要があるメソッドが定義された、構造体インスタンスのスライスです。
名前: Bind<br/> データ型: `[]interface{}`
@ -383,13 +383,13 @@ A slice of struct instances defining methods that need to be bound to the fronte
#### 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.
この値を`true`に設定すると、アルファ値が`0`の際に、WebViewの背景が透明になります。 つまり、CSSで`background-color`に`rgba(0,0,0,0)`を設定すると、ホストウィンドウが透けて見えるようになります。 多くの場合、[WindowIsTranslucent](#WindowIsTranslucent)と組み合わて、霜のように見えるアプリケーションを作成する際に使用します。
名前: WebviewIsTransparent<br/> データ型: `bool`
#### WindowIsTranslucent
Setting this to `true` will make the window background translucent. 多くの場合、[WebviewIsTransparent](#WebviewIsTransparent)と組み合わせて使用されます。
この値を`true`に設定すると、ウィンドウの背景が半透明になります。 多くの場合、[WebviewIsTransparent](#WebviewIsTransparent)と組み合わせて使用されます。
ビルド22621より前のWindows 11の場合、半透明を実現させるために[BlurBehind](https://learn.microsoft.com/ja-jp/windows/win32/dwm/blur-ovw)メソッドを使用するため、処理が遅くなる可能性があります。 ビルド22621以降のWindows 11では、より高速な、新しい半透明タイプが有効になります。 デフォルトで使用される半透明タイプは、Windowsにより決定されます。 このタイプを設定するには、[BackdropType](#BackdropType)オプションを使用してください。
@ -409,7 +409,7 @@ Setting this to `true` will make the window background translucent. 多くの場
値は次のいずれかを指定してください:
| 値 | Description |
| 値 | 説明 |
| ------- | ----------------------------------------------------------------------------------- |
| Auto | Windowsに背景を決定させる |
| None | 半透明にしない |
@ -419,45 +419,45 @@ Setting this to `true` will make the window background translucent. 多くの場
#### DisableWindowIcon
Setting this to `true` will remove the icon in the top left corner of the title bar.
この設定を`true`にすると、タイトルバーの左上隅のアイコンが消去されます。
名前: DisableWindowIcon<br/> データ型: `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.
この設定を`true`にすると、[フレームレス](#Frameless)モードでのウィンドウデコレーションが消去されます。 つまり、'Aero Shadow'および'Rounded Corners'がウィンドウに適用されなくなります。 なお、'Rounded Corners'はWindows 11でのみサポートされていますのでご注意ください。
名前: DisableFramelessWindowDecorations<br/> データ型: `bool`
#### WebviewUserDataPath
This defines the path where the WebView2 stores the user data. If empty `%APPDATA%\[BinaryName.exe]` will be used.
WebView2が、ユーザデータを格納するパスを設定します。 空の場合は、`%APPDATA%\[BinaryName.exe]`が使用されます。
名前: WebviewUserDataPath<br/> データ型: `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.
WebView2の実行ファイルおよびライブラリが存在するディレクトリへのパスを設定します。 空の場合、システムにインストールされているWebView2が使用されます。
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)
- [ランタイムの取得および展開方法](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode)
- [固定バージョンに関する既知の問題](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#known-issues-for-fixed-version)
- [WenView2ランタイムの固定バージョンのパスに、\Edge\Application\ を含めてはいけません](https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.1245.22#createcorewebview2environmentwithoptions)
名前: WebviewBrowserPath<br/> データ型: `string`
#### Theme
Minimum Windows Version: Windows 10 2004/20H1
サポートされるWindowsの最小バージョン: Windows 10 2004/20H1
This defines the theme that the application should use:
アプリケーションが使用するテーマを設定します:
| 値 | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| SystemDefault | _デフォルト値_です。 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 |
| 値 | 説明 |
| ------------- | ---------------------------------------------------------------------------------------- |
| SystemDefault | _デフォルト値_です。 テーマは、システムのデフォルト設定に基づきます。 ユーザがシステムのテーマ設定を変更した場合、アプリケーションは新しい設定を使用するように更新されます。 |
| Dark | アプリケーションはダークテーマのみを使用します。 |
| Light | アプリケーションはライトテーマのみを使用します。 |
名前: Theme<br/> データ型: `windows.Theme`
@ -469,15 +469,15 @@ This defines the theme that the application should use:
:::
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.
ウィンドウがアクティブまたは非アクティブのときに、ライトモード・ダークモードのそれぞれにおいて、タイトルバー、タイトルテキスト、ボーダーのカスタムカラーを設定できます。
名前: CustomTheme<br/> データ型: `windows.CustomTheme`
##### CustomTheme 型
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)`.
CustomTheme構造体は、`int32`型で色の値を指定します。 これは`0x00BBGGAA`で表されるWindowsの標準フォーマットで指定します。 RGBの値をこのフォーマットに変換するために、`windows.RGB(r,g,b uint8)`のようなヘルパー関数が用意されています。
NOTE: Any value not provided will default to black.
注意: 指定されていない値はデフォルトで黒色になります。
```go
type ThemeSettings struct {
@ -496,7 +496,7 @@ type ThemeSettings struct {
}
```
Example:
:
```go
CustomTheme: &windows.ThemeSettings{
@ -519,15 +519,15 @@ Example:
#### Messages
A struct of strings used by the webview2 installer if a valid webview2 runtime is not found.
利用可能なWebView2ランタイムが見つからなかったときに表示する、WebView2インストーラに関するメッセージ文字列を設定します。
名前: Messages<br/> データ型: `*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.
ResizeDebounceMSは、ウィンドウサイズが変更されたときに、WebView2の再描画を実行するまでの時間です。 デフォルト値(0) は、できるだけ早く再描画を実行します。
名前: ResizeDebounceMS<br/> データ型: `uint16`
@ -551,13 +551,13 @@ Windowsがローパワーモード(サスペンド/休止状態) から復帰し
#### TitleBar
The TitleBar struct provides the ability to configure the look and feel of the title bar.
TitleBar構造体は、タイトルバーのルック・アンド・フィールを設定する機能を提供します。
名前: TitleBar<br/> データ型: [`*mac.TitleBar`](#titlebar-struct)
##### Titlebar struct
##### Titlebar 構造体
The titlebar of the application can be customised by using the TitleBar options:
アプリケーションのタイトルバーは、TitleBarオプションを使用することでカスタマイズできます:
```go
type TitleBar struct {
@ -570,24 +570,24 @@ type TitleBar struct {
}
```
| 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) |
| 名前 | 説明 |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TitlebarAppearsTransparent | タイトルバーを透明にします。 これにより、タイトルバーが非表示になり、コンテンツがウィンドウ全体に表示されます。 [Appleドキュメント](https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc) |
| HideTitle | ウィンドウタイトルを非表示にします。 [Appleドキュメント](https://developer.apple.com/documentation/appkit/nswindowtitlevisibility?language=objc) |
| HideTitleBar | スタイルマスクから[NSWindowStyleMaskTitled](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemasktitled/)を消去します。 |
| FullSizeContent | WebViewをウィンドウ全体に表示します。 [Appleドキュメント](https://developer.apple.com/documentation/appkit/nswindowstylemask/nswindowstylemaskfullsizecontentview) |
| UseToolbar | ウィンドウにデフォルトツールバーを追加します。 [Appleドキュメント](https://developer.apple.com/documentation/appkit/nstoolbar?language=objc) |
| HideToolbarSeparator | ツールバーの下側の線を消去します。 [Appleドキュメント](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{
@ -595,30 +595,30 @@ Mac: &mac.Options{
}
```
Click [here](https://github.com/lukakerr/NSWindowStyles) for some inspiration on customising the titlebar.
タイトルバーのカスタマイズに関してインスピレーションを得たい場合は[こちら](https://github.com/lukakerr/NSWindowStyles)をご覧ください。
#### 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.
Appearanceは、Appleの[NSAppearance](https://developer.apple.com/documentation/appkit/nsappearancename?language=objc)Nameに従って、アプリケーションのスタイルを設定するために使用します。
名前: Appearance<br/> データ型: [`mac.AppearanceType`](#appearance-type)
##### Appearance 型
You can specify the application's [appearance](https://developer.apple.com/documentation/appkit/nsappearance?language=objc).
アプリケーションの[外観](https://developer.apple.com/documentation/appkit/nsappearance?language=objc)を指定します。
| 値 | 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 |
| 値 | 説明 |
| ----------------------------------------------------- | ------------------------------------- |
| DefaultAppearance | DefaultAppearanceは、システムのデフォルト値を使用します。 |
| NSAppearanceNameAqua | システムの標準的なライト外観 |
| NSAppearanceNameDarkAqua | システムの標準的なダーク外観 |
| NSAppearanceNameVibrantLight | より鮮やかなライト外観 |
| NSAppearanceNameAccessibilityHighContrastAqua | システムの標準的なライト外観のハイコントラスト版 |
| NSAppearanceNameAccessibilityHighContrastDarkAqua | システムの標準的なダーク外観のハイコントラスト版 |
| NSAppearanceNameAccessibilityHighContrastVibrantLight | より鮮やかなライト外観のハイコントラスト版 |
| NSAppearanceNameAccessibilityHighContrastVibrantDark | より鮮やかなダーク外観のハイコントラスト版 |
Example:
:
```go
Mac: &mac.Options{
@ -628,23 +628,23 @@ Mac: &mac.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.
この値を`true`に設定すると、アルファ値が`0`の際に、WebViewの背景が透明になります。 つまり、CSSで`background-color`に`rgba(0,0,0,0)`を設定すると、ホストウィンドウが透けて見えるようになります。 多くの場合、[WindowIsTranslucent](#WindowIsTranslucent)と組み合わて、霜のように見えるアプリケーションを作成する際に使用します。
名前: WebviewIsTransparent<br/> データ型: `bool`
#### WindowIsTranslucent
Setting this to `true` will make the window background translucent. Often combined with [WebviewIsTransparent](#WebviewIsTransparent) to make frosty-looking applications.
この値を`true`に設定すると、ウィンドウの背景が半透明になります。 多くの場合、[WebviewIsTransparent](#WebviewIsTransparent)と組み合わて、霜のように見えるアプリケーションを作成する際に使用します。
名前: WindowIsTranslucent<br/> データ型: `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.
"AppMenu"ロールで作成されたアプリケーションメニューの中にある"About"メニュー項目において、タイトル、メッセージ、アイコンを設定できます。
名前: About<br/> データ型: [`*mac.AboutInfo`](#about-struct)
##### About struct
##### About 構造体
```go
@ -655,7 +655,7 @@ type AboutInfo struct {
}
```
If these settings are provided, an "About" menu item will appear in the app menu (when using the `AppMenu` role). Given this configuration:
これらの設定が定義されている場合、`AppMenu`ロールが使用されていれば、アプリケーションメニュー内に"About"メニューが表示されます。 例えば以下のように設定すると:
```go
//go:embed build/appicon.png
@ -674,7 +674,7 @@ func main() {
})
```
The "About" menu item will appear in the app menu:
アプリケーションメニューに"About"メニュー項目が表示されます:
```mdx-code-block
<div class="text--center">
@ -686,7 +686,7 @@ The "About" menu item will appear in the app menu:
<br />
```
When clicked, that will open an about message box:
クリックすると、アプリケーション概要メッセージボックスが開かれます:
```mdx-code-block
<div class="text--center">
@ -707,23 +707,23 @@ When clicked, that will open an about message box:
#### Icon
Sets up the icon representing the window. This icon is used when the window is minimized (also known as iconified).
ウィンドウを示すアイコンを設定します。 このアイコンは、ウィンドウが最小化されたときに使用されます(iconifiedと呼ばれます)。
名前: Icon<br/> データ型: `[]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.
一部のウィンドウマネージャやデスクトップ環境では、ウィンドウフレームに配置されたり、他のコンテキストで表示される場合もあります。 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.
注意: 少なくともWayland上のGnomeでは、このアイコンは表示されません。 アプリケーションアイコンを表示させるには、`.desktop`ファイルを使用する必要があります。 KDEの場合は正常に表示されるはずです。
The icon should be provided in whatever size it was naturally drawn; that is, dont scale the image before passing it. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
アイコンは、何の加工もされていないサイズで用意してください。つまり、拡大/縮小された画像は使用しないでください。 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. ウィンドウマネージャによっては、この設定を無視したり、ブラックウィンドウになる場合があります。
この値を`true`に設定すると、ウィンドウの背景が半透明になります。 ウィンドウマネージャによっては、この設定を無視したり、ブラックウィンドウになる場合があります。
名前: WindowIsTranslucent<br/> データ型: `bool`
### デバッグ
### Debug
デバッグビルド時に適用される[デバッグ固有のオプション](#Debug)を定義します。

View File

@ -11,20 +11,20 @@ The project config resides in the `wails.json` file in the project directory. Th
"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`]",
"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]",
"build:dir": "[ビルドファイルが存在するディレクトリ。 デフォルトは'build'です。']",
"frontend:dir": "[フロントエンドディレクトリの相対パス。 デフォルトは'frontend'です。]",
"frontend:install": "[node依存関係をインストールするために、フロントエンドディレクトリで実行するコマンド。一般的には`npm install`です。]",
"frontend:build": "[アセットをビルドするために、フロントエンドディレクトリで実行するコマンド。一般的には`npm run build`です。]",
"frontend:dev": "[このコマンドはfrontend:dev:buildへ置換されました。 If frontend:dev:build is not specified will falls back to this command. このコマンドも指定されていない場合は、代わりにfrontend:buildが実行されます。]",
"frontend:dev:build": "[開発モードにおける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]",
"frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. 'auto'に設定すると、Viteの出力から自動的に開発サーバURLを推測します。]",
"wailsjsdir": "[自動生成されるJSモジュールを出力するディレクトリへの相対パス。]",
"version": "[プロジェクト構成のバージョン]",
"outputfilename": "[出力バイナリのファイル名]",
"debounceMS": 100, // アセットファイルに変更があった場合に、開発サーバが再読み込みを行うまでのデフォルトの待ち時間。
"devServer": "[Wailsの開発サーバをバインドするアドレス。 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": {
@ -44,9 +44,9 @@ The project config resides in the `wails.json` file in the project directory. Th
"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]"
"nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. デフォルト値: 'multiple']",
"obfuscated": "[アプリ難読化を実行するかどうか。 デフォルト値: false]",
"garbleargs": "[obfuscatedフラグがtrueの際に、garbleコマンドへ渡す引数。]"
}
```

View File

@ -2,11 +2,11 @@
sidebar_position: 5
---
# ダイアログ
# Dialog
ランタイムでは、ファイルセレクターやメッセージボックスといったネイティブダイアログへのアクセスを提供しています。
:::info Javascript
:::info JavaScript
現在、Javascriptランタイムではダイアログをサポートしていません。

View File

@ -2,9 +2,9 @@
sidebar_position: 2
---
# イベント
# Events
Wailsでは、GoまたはJavascriptによって発行および受信できる、一元化されたイベントシステムが用意されています。 必要に応じて、イベント発行時にデータを渡すことも可能です。 イベントリスナーは、そのデータをローカルデータ型で受け取ります。
The Wails runtime provides a unified events system, where events can be emitted or received by either Go or JavaScript. 必要に応じて、イベント発行時にデータを渡すことも可能です。 イベントリスナーは、そのデータをローカルデータ型で受け取ります。
### EventsOn

View File

@ -2,17 +2,17 @@
sidebar_position: 1
---
# イントロダクション
# Introduction
ランタイムは、アプリケーションにユーティリティメソッドを提供するライブラリです。 GoとJavascriptの両方にランタイムがあり、どちらにもほぼ同じメソッドが提供されています。
ランタイムは、アプリケーションにユーティリティメソッドを提供するライブラリです。 There is both a Go and JavaScript runtime and the aim is to try and keep them at parity where possible.
ユーティリティメソッドには次のようなものがあります:
- [ウィンドウ](window.mdx)
- [Menu](menu.mdx)
- [Window](window.mdx)
- [メニュー](menu.mdx)
- [ダイアログ](dialog.mdx)
- [イベント](events.mdx)
- [Browser](browser.mdx)
- [ブラウザ](browser.mdx)
- [ログ](log.mdx)
Goのランタイムは、`github.com/wailsapp/wails/v2/pkg/runtime`をインポートすることで利用できます。 このパッケージのすべてのメソッドは、1番目の引数でContextを渡す必要があります。 このContextは、[OnStartup](../options.mdx#onstartup)フック、または[OnDomReady](../options.mdx#ondomready)フックからあらかじめ取得しておいてください。
@ -23,7 +23,7 @@ Goのランタイムは、`github.com/wailsapp/wails/v2/pkg/runtime`をインポ
:::
Javascriptのランタイムは、`window.runtime`マップを介してフロントエンド上で利用できます。 `dev`モードでは、Typescript型定義を提供するランタイムパッケージが生成されます。 これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
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. これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
### 非表示

View File

@ -2,9 +2,9 @@
sidebar_position: 3
---
# ログ
# Log
Wailsでは、GoまたはJavascriptから呼び出すことのできるロギングメカニズムを用意しています。 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
The Wails runtime provides a logging mechanism that may be called from Go or JavaScript. 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
- トレース
- デバッグ
@ -101,7 +101,7 @@ Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
### LogSetLogLevel
出力ログレベルを設定します。 Javascriptでは、数値が次のログレベルに対応しています:
出力ログレベルを設定します。 In JavaScript, the number relates to the following log levels:
| 値 | ログレベル |
| - | ----- |

View File

@ -2,11 +2,11 @@
sidebar_position: 6
---
# Menu
# メニュー
これらは、アプリケーションメニューに関連したメソッドです。
:::info Javascript
:::info JavaScript
現在、Javascriptランタイムではメニューをサポートしていません。

View File

@ -200,7 +200,7 @@ Windowsの場合、0または255のアルファ値(A) のみがサポートさ
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
## Typescript型定義
## TypeScript Object Definitions
### Position

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.0.0-rc.1"
},
"sidebar.docs.category.Getting Started": {
"message": "はじめよう",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "リファレンス",
"message": "Reference",
"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": "コミュニティ",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "事例紹介",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
"message": "ガイド",
"message": "Guides",
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "チュートリアル",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "コントリビューション",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.0.0"
},
"sidebar.docs.category.Getting Started": {
"message": "はじめよう",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "リファレンス",
"message": "Reference",
"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": "コミュニティ",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "事例紹介",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
"message": "ガイド",
"message": "Guides",
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "チュートリアル",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "コントリビューション",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.1.0"
},
"sidebar.docs.category.Getting Started": {
"message": "はじめよう",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "リファレンス",
"message": "Reference",
"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": "コミュニティ",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "事例紹介",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
"message": "ガイド",
"message": "Guides",
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "チュートリアル",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "コントリビューション",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -4,11 +4,11 @@
"description": "The label for version v2.2.0"
},
"sidebar.docs.category.Getting Started": {
"message": "はじめよう",
"message": "Getting Started",
"description": "The label for category Getting Started in sidebar docs"
},
"sidebar.docs.category.Reference": {
"message": "リファレンス",
"message": "Reference",
"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": "コミュニティ",
"message": "Community",
"description": "The label for category Community in sidebar docs"
},
"sidebar.docs.category.Showcase": {
"message": "事例紹介",
"message": "Showcase",
"description": "The label for category Showcase in sidebar docs"
},
"sidebar.docs.category.Guides": {
"message": "ガイド",
"message": "Guides",
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.Tutorials": {
"message": "チュートリアル",
"message": "Tutorials",
"description": "The label for category Tutorials in sidebar docs"
},
"sidebar.docs.link.Contributing": {
"message": "コントリビューション",
"message": "Contributing",
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
}
}

View File

@ -1,4 +1,4 @@
# 変更履歴
# Changelog
All notable changes to this project will be documented in this file.
@ -17,10 +17,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 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)
- Add new property for the `wails.json` config file - `bindings`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Properties `prefix` and `suffix` allow you to control the generated TypeScript entity name in the `model.ts` file. Added by @OlegGulevskyy in [PR](https://github.com/wailsapp/wails/pull/2101)
- The `WindowSetAlwaysOnTop` method is now exposed in the JS runtime. Fixed by @gotid in [PR](https://github.com/wailsapp/wails/pull/2128)
### 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)
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
## v2.2.0 - 2022-11-09
@ -39,7 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### 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)
- 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
@ -84,7 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 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
- 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
@ -479,7 +482,7 @@ Experimental: &options.Experimental{
- 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)
- 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)
@ -489,7 +492,7 @@ Experimental: &options.Experimental{
- 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)
- 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)

Some files were not shown because too many files have changed in this diff Show More