-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Update French translation #11077
base: master
Are you sure you want to change the base?
Update French translation #11077
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eliovir Hi. Just need to address the fn translations
src/resources/dicts/fr.edn
Outdated
@@ -803,4 +823,18 @@ | |||
:settings-page/auto-chmod "Automatiquement changer les permissions du fichier" | |||
:settings-page/auto-chmod-desc "Désactiver pour permettre l'édition par plusieurs utilisateurs avec les permissions données par l'appartenance au groupe." | |||
:settings-page/tab-keymap "Raccourcis" | |||
:unlinked-references/reference-count (fn [total] (str total (if (= total 1) " référence non liée" " références non liées")))} | |||
:unlinked-references/reference-count (fn [total] | |||
(cond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For fn translations, we now want them to remain simple and to only use the following fns: str, when, if and =. These new rules are in place because this specific translation caused a bug that required a separate release. While cond
could be rewritten to use if
, these are too many if branches to be considered simple and this should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for reviewing the PR.
I know the rule.
The bug existed due to use of undocumented nil
. This is the limit of using uncommon format for translation.
The use of cond
is needed if a good translation is expected. The current translation does not give correct sentence.
I think that cond
is shorter and clearer than if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nil is causing complex translations then feel free to file an issue or contribute a fix for the component itself. We aren't looking to maintain needlessly complex translations as workarounds to component state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for your comment.
I agree that complex translation is not the right way.
I wonder how can I simply translate those cases for :linked-references/reference-count
.
value for filtered-count |
value for total |
Wanted sentence for fr.cdn | In en.cdn | |
---|---|---|---|---|
nil | 0 | Aucune référence liée | No linked references | "0 Linked References" |
nil | 1 | 1 référence liée | 1 linked reference | "1 Linked Reference" |
nil | > 1 | {total} références liées | {total} linked references | "{total} Linked References" |
1 | 1 | 1 référence liée / 1 | 1 linked reference / 1 | "1 of 1 Linked Reference" |
>1 | > 1 | {filtered-count} références liées / {total} | {filtered-count} linked references / {total} | "{filtered-count} of {total} Linked References" |
I'm not comfortable with this programming language, maybe @xyhp915, @DavidLapous, @viviicat, @SylvainDuran, @jomanhattan, @sprocketc who authored on this file can help.
PS: you must take care that some languages use several plural forms.
Example for the definition for 3 Polish plural forms in Gettext:
Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how can I simply translate those cases for :linked-references/reference-count
There is nothing simple about handling so many branches in a translation file. My recommendation is still to revert the changes to the fn translations. These fn translations can be revisited in a later PR when nils in the components have been resolved by others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove cond
and simplified the translation, removing the case when total
is 0.
Do you agree with the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logseq-cldwalker is it OK for you?
@@ -172,7 +172,23 @@ | |||
:linked-references/filter-excludes "Exclut : " | |||
:linked-references/filter-heading "Filtrer" | |||
:linked-references/filter-includes "Inclut : " | |||
:linked-references/reference-count (fn [filtered-count total] (str filtered-count (when filtered-count (if (= filtered-count 1) " référence liée" " références liées")) " parmi " total)) | |||
:linked-references/reference-count (fn [filtered-count total] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also worth reverting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the current translation is not correct: if filtered-count is nil, the translation is "parmi total" ("among total" which is too short to be clear).
Do you have another solution to make plural translations which handle all cases with short syntax without cond
?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also simplified the translation, removing the case when total
is 0.
Do you agree with the changes?
Change syntax to avoid `cond` according to code review.
langage => langue
Add missing strings.
Handle more plural forms (0, "", nil).