Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update Swedish translation file #44

Merged
merged 12 commits into from
Mar 2, 2025

Conversation

ThatKalle
Copy link
Collaborator

@ThatKalle ThatKalle commented Feb 26, 2025

Updated the Swedish translation file se.yml.

  • Ran command as per README.md to generate new lines.
  • Translated new lines
    adjusted ordering and formatting to match en.yml
  • Aligned a couple of strings to match the Android app translations in crowdin
    primarily the role indications are not directly translated to swedish

@ThatKalle ThatKalle changed the title Update Swedish translation file fix: Update Swedish translation file Feb 26, 2025
@mverch67
Copy link
Collaborator

I think the lv_i18n tool is generating wrong code that must be manually corrected, especially all translations that contain a \n must be enclosed in double quotes.

@ThatKalle
Copy link
Collaborator Author

Some git schenanigans going on as per usual 😂 It's probably time for me to reboot my pc

I think I managed to add "s on all the lines where \n was.

@iliaschat
Copy link
Contributor

iliaschat commented Feb 27, 2025

Whether there are errors (wrongly punctuated strings with escaped characters) from previous versions, then what happens is that when we run lv_i18n extract, the parser will go and re-parse the lines containing 'badly' escaped characters to their actual value:

Examples

Example 1

From:
'choose\nnode': 'välj\nnod'

To:
'choose\nnode': |-
välj
nod

Example 2

From:
'LONG FAST\nLONG SLOW\n-- deprecated --\nMEDIUM SLOW\nMEDIUM FAST\nSHORT SLOW\nSHORT FAST\nLONG MODERATE\nSHORT TURBO': 'Lång räckvidd / Snabb\nLång räckvidd / Långsam\n-- utfasad --\nMedium Räckvidd / Långsam\nMedium räckvidd / Långsam\nMedium räckvidd / Snabb\nKort räckvidd / Långsam\nKort räckvidd / Snabb\nLång räckvidd / Måttlig\nKort räckvidd / Turbo'

To:
'LONG FAST\nLONG SLOW\n-- deprecated --\nMEDIUM SLOW\nMEDIUM FAST\nSHORT SLOW\nSHORT FAST\nLONG MODERATE\nSHORT TURBO': |-
Lång räckvidd / Snabb
Lång räckvidd / Långsam
-- utfasad --
Medium Räckvidd / Långsam
Medium räckvidd / Långsam
Medium räckvidd / Snabb
Kort räckvidd / Långsam
Kort räckvidd / Snabb
Lång räckvidd / Måttlig
Kort räckvidd / Turbo

Once it's fixed and done correctly by using double quotes " around keywords with escaped characters, then it will not do that problem again on next lv_i18n extract.

The current problem arises because lv_i18n is currently struggling to produce the correct punctuation marks.
But that's only when it adds new keywords. Once we fix it, then it won't deal with it again.

I hope this makes sense.

@mverch67
Copy link
Collaborator

mverch67 commented Feb 27, 2025

Whether there are errors (wrongly punctuated strings with escaped characters) from previous versions, then what happens is that when we run lv_i18n extract, the parser will go and re-parse the lines containing 'badly' escaped characters to their actual value:

Examples

Example 1

From: 'choose\nnode': 'välj\nnod'

To: 'choose\nnode': |- välj nod

Example 2

From: 'LONG FAST\nLONG SLOW\n-- deprecated --\nMEDIUM SLOW\nMEDIUM FAST\nSHORT SLOW\nSHORT FAST\nLONG MODERATE\nSHORT TURBO': 'Lång räckvidd / Snabb\nLång räckvidd / Långsam\n-- utfasad --\nMedium Räckvidd / Långsam\nMedium räckvidd / Långsam\nMedium räckvidd / Snabb\nKort räckvidd / Långsam\nKort räckvidd / Snabb\nLång räckvidd / Måttlig\nKort räckvidd / Turbo'

To: 'LONG FAST\nLONG SLOW\n-- deprecated --\nMEDIUM SLOW\nMEDIUM FAST\nSHORT SLOW\nSHORT FAST\nLONG MODERATE\nSHORT TURBO': |- Lång räckvidd / Snabb Lång räckvidd / Långsam -- utfasad -- Medium Räckvidd / Långsam Medium räckvidd / Långsam Medium räckvidd / Snabb Kort räckvidd / Långsam Kort räckvidd / Snabb Lång räckvidd / Måttlig Kort räckvidd / Turbo

Once it's fixed and done correctly by using double quotes " around keywords with escaped characters, then it will not do that problem again on next lv_i18n extract.

The current problem arises because lv_i18n is currently struggling to produce the correct punctuation marks. But that's only when it adds new keywords. Once we fix it, then it won't deal with it again.

I hope this makes sense.

I think I saw that when I run the lv_i18n extract again then it does not identify the existing/changed double quote translations as existing keys in its database but instead adds another set of translations from the sources again without the \n in the style you mentioned above. Correct me if I'm wrong.

@iliaschat
Copy link
Contributor

I think I saw that when I run the lv_i18n extract again then it does not identify the existing/changed double quote translations as existing keys in its database but instead adds another set of translations from the sources again without the \n in the style you mentioned above. Correct me if I'm wrong.

You are absolutely right that this happens. I just re-tested the extraction against the el.yml file. It also proved me wrong regarding my earlier comments. It still changes the double-quoted escaped lines into individual lines.

By the way, I recently came across this PR: lvgl/lv_i18n#68. I'm wondering how relevant it is to our issue.

@mverch67
Copy link
Collaborator

By the way, I recently came across this PR: lvgl/lv_i18n#68. I'm wondering how relevant it is to our issue.

yeah, it's lvgl/lv_i18n#66 exactly

@mverch67 mverch67 merged commit 50925f9 into meshtastic:master Mar 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants