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

[Summary] Translation system overhaul #27700

Open
3 tasks done
Tracked by #30261
denyskon opened this issue Oct 19, 2023 · 12 comments
Open
3 tasks done
Tracked by #30261

[Summary] Translation system overhaul #27700

denyskon opened this issue Oct 19, 2023 · 12 comments
Assignees
Labels
type/summary This issue aggregates a bunch of other issues

Comments

@denyskon
Copy link
Member

denyskon commented Oct 19, 2023

Cleanup translations

General overhaul

Docs translation

@denyskon denyskon added the type/summary This issue aggregates a bunch of other issues label Oct 19, 2023
@denyskon denyskon added this to the 1.22.0 milestone Oct 19, 2023
@denyskon denyskon self-assigned this Oct 19, 2023
@wxiaoguang
Copy link
Contributor

Share some of my thoughts.

Many translations in non-English locale are out-dated or event incorrect, because they didn't get updates when the English messages change.

To make the translations clear, the first step is to git blame every key's change, remove all outdated keys from non-English locales, sync to Crowdin.

@silverwind
Copy link
Member

silverwind commented Oct 20, 2023

Many translations in non-English locale are out-dated or event incorrect, because they didn't get updates when the English messages change.

We need to invalidate all affected tokens in all languages when english changes, it's the only sane config. It's doubly problematic if the % tokens in the message change, which will break rendering.

@lunny
Copy link
Member

lunny commented Mar 4, 2024

Moved this out of 1.22 because a summary issue may cross multiple milestones.

@silverwind
Copy link
Member

silverwind commented Mar 15, 2024

I think a good first step is when someone with access to crowdin admin panel would take a look at integrating https://github.com/crowdin/github-action, replacing the current ini workflow. Maybe a small script could be written that outputs the ini format to ease the transition.

It would enable contributors to configure crowdin in-repo and likely gain a deeper understanding of the process in turn.

@go-gitea/technical-oversight-committee can anyone with crowdin admin get this started?

@denyskon
Copy link
Member Author

After fighting with the mess in our current translation files again and again, I think these are the steps we need to do:

    1. Cleanup translation strings massively, reduce amount of translations, get rid of deep nesting.
    1. Invalidate all translations whose source strings are newer.
    1. Convert to a better file format, e. g. JSON or YML
    1. Move translations over to Weblate

We could also do 3. independently, but I don't have an overview of how the files are parsed currently

@silverwind
Copy link
Member

silverwind commented Mar 16, 2024

One step I would like to do is to flatten the ini to make the keys greppable, e.g. turning

[foo]
bar.baz = qux

into

foo.bar.baz = qux

This can be easily done with a script and should be compatible with all the code. Question is just whether it might break anything regarding the crowdin sync.

@denyskon
Copy link
Member Author

Alright, I have some spare time for a moment, so let's finally go forward with this.

I propose the following steps:

  1. Clean up the translation files from all strings which are older than their source strings and thus outdated, then sync to Crowdin afterwards

as proposed by @wxiaoguang

  1. Flatten the ininstructure to have grepable strings (allowing for translation lint) and easier further migration

as proposed above by @silverwind

  1. Convert translation files to a better format (probably JSON)

  2. Examine the possibility of a switch to Weblate

Of course all these changes would be made with high caution and I plan to always double-check that we don't break Crowdin.

@go-gitea/technical-oversight-committee please review the plan and tell me if I can go forward with it

@lafriks
Copy link
Member

lafriks commented Aug 15, 2024

  1. Switching to weblate is still problematic as it does not support getting back to git repo only approved translations

@denyskon
Copy link
Member Author

  1. Switching to weblate is still problematic as it does not support getting back to git repo only approved translations

@lafriks Are you sure? Their docs sounds like they also have an approval system...

@lafriks
Copy link
Member

lafriks commented Aug 15, 2024

Yes but translations are pushed back to source code even before approval

It's been long open issue WeblateOrg/weblate#3745

@denyskon
Copy link
Member Author

Unfortunately after a lot of research I had to find out that 1. is not possible to do automatically as Crowdin does not support deleting all translation strings missing in an uploaded file. I started unapproving the outdated strings manually on Crowdin, but it will take a while...

@denyskon
Copy link
Member Author

I now finished manually cleaning out translation strings which are newer than the source string, Should be done with next Crowdin pull :)

lunny pushed a commit that referenced this issue Sep 2, 2024
Part of #27700

Removes all URLs from translation strings to easy up changing them in
the future and to exclude people injecting malicious URLs through
translations. First measure as long as #24402 is out of scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/summary This issue aggregates a bunch of other issues
Projects
None yet
Development

No branches or pull requests

5 participants