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

Improve translatability of the new "History Page" feature #576

Closed
zorun opened this issue Apr 24, 2020 · 4 comments
Closed

Improve translatability of the new "History Page" feature #576

zorun opened this issue Apr 24, 2020 · 4 comments
Milestone

Comments

@zorun
Copy link
Collaborator

zorun commented Apr 24, 2020

The new History Page (#553), while awesome, is a bit hard to translate as it stands currently.

The first problem is that the type of object is uppercased, because it's the first word in English. However, it might not be the first word in other sentences. For instance: Participant Foo added could be translated as Ajout du participant Foo or even Ajout de Foo comme nouveau participant.

The second problem is that sentences are made of several small translatable strings such as _("added"), _("and"), etc. Without context, this is hard to translate, and it also doesn't allow to reorder parts of the sentence in different languages (see example above).

Translatable strings should be built as a single string with variable interpolation, for instance:

Person %(name)s added
Bill %(bill_description)s removed
Bill %(bill_description)s: amount changed from %(old_amount)s to %(new_amount)s
Bill %(bill_description)s: date changed from %(old_date)s to %(new_date)s

I'm not sure how to best handle markup: it can be either added to the translatable string, or can be added at interpolation time (i.e. %(bill_description)s would be replaced by <em>My bill description</em>). I think the second solution is better.

@Andrew-Dickinson I had a look at the template and the macros. Unfortunately it looks like it would require a large amount of changes :/

@Natim
Copy link
Member

Natim commented Apr 25, 2020

I did a first pass in #581 to be able to translate it in French. It could be sufficient for now. Let's iterate if we see other issues.

@zorun
Copy link
Collaborator Author

zorun commented Apr 25, 2020

As always the devil is in the details ;) With the current French translation:

Facture 42.0 for Test ajouté
Facture 42.0 for Test: Supprimé Machin du Liste des débiteurs 
Facture 42.0 for Test: Ajouté Norbert et Bidule au Liste des débiteurs 
Facture 42.0 for Test renommé en Nouveau nom

Some of the issues: no space before ":", wrong accords like "ajouté" instead of "ajoutée", inconsistent upper-case, "du liste" instead of "de la liste"...

Having whole strings to translate would easily solve all these issues for all languages.

The weird part 42.0 for <description> is another issue, see #584

@Andrew-Dickinson
Copy link
Contributor

@zorun Should be mostly fixed now, can you take a look at #587 and let me know if you see anything I missed?

@zorun zorun added this to the v5 milestone Jul 17, 2020
@Glandos
Copy link
Member

Glandos commented Jul 12, 2021

Closed via #587

@Glandos Glandos closed this as completed Jul 12, 2021
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

No branches or pull requests

4 participants