Skip to content

Commit

Permalink
Info on localization development features (#210)
Browse files Browse the repository at this point in the history
* Info on localization development features

* Correct mention of Tolgee integration

Co-authored-by: mircearoata <mircearoatapalade@gmail.com>

* Move .local file ignore to frontend gitignore

* Reword mention of pnpm commands

---------

Co-authored-by: mircearoata <mircearoatapalade@gmail.com>
  • Loading branch information
budak7273 and mircearoata authored Aug 11, 2024
1 parent edb9f7b commit f22a269
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
dist
*.syso


.DS_Store

# Created by https://www.toptal.com/developers/gitignore/api/goland+all,go,visualstudiocode
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ The command line output will also include a localhost URL you can visit in your

Make sure you don't already have a copy of the application running or the command will silently fail.

Although `wails dev` should run these commands for you under normal circumstances,
you may need to run `pnpm graphql-codegen` in the `frontend` directory to update the code generated from the SMR API,
or run `pnpm translations` to update the translation data.

### Building

```bash
Expand All @@ -81,3 +85,17 @@ Then, to run it, use:
```bash
golangci-lint run --fix
```

### Localization

If you'd like to help translate and localize SMM to different languages, join our [discord server](https://discord.ficsit.app/).

SMM handles localization through the Tolgee Svelte integration.
This allows for [in-context translation](https://tolgee.io/js-sdk/) - simply alt-click on a translatable element to open the Tolgee interface.

In order to edit translations in-context, you will need to provide a tolgee API key with edit permissions.
You can create an API key for yourself [here](https://translate.ficsit.app/projects/4/integrate) once you're added to the project.
To supply this API key at development time, create or edit `/frontend/.env.local` and supply the key in a similar format as `.env`.

The in-context translation screenshot feature requires installing the _Tolgee Tools_ browser extension.
After running `wails dev`, open `http://localhost:34115/` in your browser of choice to access the application.
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
"Konami",
"Maximised",
"Minimised",
"mircearoata",
"Nyan",
"smmanager",
"smmprofile",
"SMUI",
"Tolgee",
"Unexpand",
"Unignore",
"urql",
"wailsjs"
"wailsjs",
"wailsjsdir"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
Expand Down
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
build
graphql.schema.json

# Files intended for local dev usage only, ex. .env.local
*.local

# wails generated files
package.json.md5
src/lib/generated/wailsjs
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/left-bar/LeftBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<div class="flex flex-col flex-auto h-full w-full space-y-4 h-md:space-y-8 overflow-y-auto">
<div class="flex flex-col gap-2">
<span class="pl-4 sticky top-0 z-[1] bg-surface-50-900-token">
<T defaultValue="Game version" keyName="left-bar.game-version"/>
<T defaultValue="Select Game Installation" keyName="left-bar.game-version"/>
</span>
<Select
name="installsCombobox"
Expand Down

0 comments on commit f22a269

Please sign in to comment.