Skip to content

feat: i18n#182

Merged
GeckoEidechse merged 39 commits intoR2NorthstarTools:mainfrom
Alystrasz:feat/i18n
Mar 28, 2023
Merged

feat: i18n#182
GeckoEidechse merged 39 commits intoR2NorthstarTools:mainfrom
Alystrasz:feat/i18n

Conversation

@Alystrasz
Copy link
Copy Markdown
Collaborator

@Alystrasz Alystrasz commented Feb 14, 2023

Adds frontend translation.

Closes #172.


TODOs
  • Translate interface
  • Add component to select language
  • Translate backend messages (mainly errors)
  • Study automatic translation of natively-English content (mods' descriptions for instance)
  • Weblate integration?

@Alystrasz
Copy link
Copy Markdown
Collaborator Author

@GeckoEidechse should I translate developer view?

@GeckoEidechse
Copy link
Copy Markdown
Member

@GeckoEidechse should I translate developer view?

While one could acquire in terms of accessibility, I'd say it's not worth it, as

  1. it's intended for developers (which generally are more fluent in English anyway), not end-users
  2. It's used a lot for PoC implementation and sees more changes then the rest of UI, meaning that translations will often be outdated ^^

@Alystrasz
Copy link
Copy Markdown
Collaborator Author

Agreed!

@Alystrasz
Copy link
Copy Markdown
Collaborator Author

The "new release available" dialog is not triggered by UI, is it?
I can't find the place to translate its content.

Capture d’écran de 2023-02-17 08-00-23

@GeckoEidechse
Copy link
Copy Markdown
Member

The "new release available" dialog is not triggered by UI, is it? I can't find the place to translate its content.

It's part of the Tauri framework. In particular, right now we are using the built-in dialogue: https://tauri.app/v1/guides/distribution/updater#built-in-dialog

Not sure how to change the language for that or if it even is changeable. We might also want to consider switching over to using the JavaScript API but that's outside of the scope of this PR either way ^^

@GeckoEidechse
Copy link
Copy Markdown
Member

I'll hopefully give it a look tonight. If there's still no review by tomorrow evening, please ping me cause I may have overlooked it ^^"

@GeckoEidechse
Copy link
Copy Markdown
Member

Actually, in the meantime, maybe also a few lines to docs on how to add new translations/languages would be nice.

@Alystrasz
Copy link
Copy Markdown
Collaborator Author

Actually, in the meantime, maybe also a few lines to docs on how to add new translations/languages would be nice.

Addressed in e727ad9 :)

@GeckoEidechse
Copy link
Copy Markdown
Member

GeckoEidechse commented Mar 20, 2023

So for some reason the UI part doesn't build on my Ubuntu 22.04 laptop

Full log

 *  Executing task: npm run tauri dev 


> tauri
> tauri dev

     Running BeforeDevCommand (`cd src-vue && npm run dev`)

> src-vue@0.0.0 dev
> vite

failed to load config from /home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/vite.config.ts
error when starting dev server:
Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild.

If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.
    at generateBinPath (/home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/esbuild/lib/main.js:1819:15)
    at esbuildCommandAndArgs (/home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/esbuild/lib/main.js:1886:33)
    at ensureServiceIsRunning (/home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/esbuild/lib/main.js:2051:25)
    at build (/home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/esbuild/lib/main.js:1942:26)
    at bundleConfigFile (file:///home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63043:26)
    at loadConfigFromFile (file:///home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63019:31)
    at resolveConfig (file:///home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:62643:34)
    at createServer (file:///home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:61943:26)
    at CAC.<anonymous> (file:///home/gecko/Documents/Coding/Northstar-stuff/Tools/FlightCore/src-vue/node_modules/vite/dist/node/cli.js:707:30)
       Error The "beforeDevCommand" terminated with a non-zero status code.

 *  The terminal process "/usr/bin/bash '-c', 'npm run tauri dev'" terminated with exit code: 1. 

I did make sure to run npm install in src-vue/ beforehand.

EDIT: Deleting node_modules and then installing them fresh again seems to solve it. No clue what's causing it but oh well...

@GeckoEidechse
Copy link
Copy Markdown
Member

GeckoEidechse commented Mar 20, 2023

I also have issues getting persistence working rn on Windows but that seems to be caused by something outside this PR?

Copy link
Copy Markdown
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't manage to get through the whole thing yet so here's an initial review of what I have so far ^^

@GeckoEidechse GeckoEidechse added the enhancement New feature or request label Mar 21, 2023
@GeckoEidechse
Copy link
Copy Markdown
Member

So far UI stuff looks good in testing. Will have to give the code another look than it should be good to merge :D

In the meantime, do you maybe wanna update branch with main again ^^

@Alystrasz Alystrasz requested a review from GeckoEidechse March 28, 2023 21:26
Copy link
Copy Markdown
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine as I can tell and it works fine in testing.
All requested changes have been addressed.
Language saves in persistence as expected now.

@GeckoEidechse GeckoEidechse added this pull request to the merge queue Mar 28, 2023
Merged via the queue into R2NorthstarTools:main with commit 428c300 Mar 28, 2023
@Alystrasz Alystrasz deleted the feat/i18n branch March 29, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translations

2 participants