Skip to content

Translate into French update 2026-05-14#948

Merged
forrestguice merged 2 commits into
forrestguice:masterfrom
chfo-bidouille:master
May 20, 2026
Merged

Translate into French update 2026-05-14#948
forrestguice merged 2 commits into
forrestguice:masterfrom
chfo-bidouille:master

Conversation

@chfo-bidouille

Copy link
Copy Markdown
Contributor

I left these two lines.
I'm not sure how to translate them.

150 <string name="offset_before_msg1">{0} avant {1, plural, one {{2, select, female {} other {}}} other {{2, select, female {} other {}}}}{3}</string> <!-- uses SelectFormat (api24+) --> <!-- TODO: review -->
151 <string name="offset_after_msg1">{0} après {1, plural, one {{2, select, female {} other {}}} other {{2, select, female {} other {}}}}{3}</string> <!-- uses SelectFormat (api24+) --> <!-- TODO: review -->

@forrestguice

forrestguice commented May 16, 2026

Copy link
Copy Markdown
Owner

Excellent, thank you.
I will merge this soon.

I left these two lines.
I'm not sure how to translate them

Those are weird. I had to remind myself how they work; https://developer.android.com/reference/android/icu/text/SelectFormat. The format is so confusing I don't expect anyone to use these, but its possible to translate those lines so they respect the gender and number of the noun.

I guess an example in Spanish is something like "it is 5 oclock" vs "it is 1 oclock", which is "son las 5" vs "es la 1. The conjugation and article are different depending on the hour.

<string name="offset_before_msg1">{0} before {1, plural, one {{2, select, female {} other {}}} other {{2, select, female {} other {}}}}{3}</string>

That eventually becomes <offset> before <event> (e.g. 1h 5min before sunset).

The code that uses it is actually MessageFormat(pattern).format( new Object[] {offsetText, plural, gender, eventText} );, so {0}, {1}, {2}, and {3} correspond to each those arguments. {0} is the offsetText 1h 5min, and {3} is the eventText sunset. {1, is a plural and {2, is the gender of the noun. The plural will be either "one" or "other", and the gender either "female" or "other".

There are a bunch of strings that end in _gender that can be used to provide the required hint. For example <string name="selectformat_time_gender" tools:common="true">female</string> indicates the gender for time phrases (in Spanish time phrases are feminine). solarevents_gender and solarevents_quantity are arrays that correspond to event entries in solarevents_long1. e.g. the items for sunset are other (for masculine since its el atardecer) and one (the article is singular el).

So the above version of offset_before_msg1 basically does nothing. It's the default which works for English (and most other languages it seems). The innermost {} are where we would provide plural and quantity translations but they are empty.

Here's the spanish version:

<string name="offset_before_msg1">{0} antes {1, plural, one {{2, select, female {de la} other {del}}} other {{2, select, female {de las} other {de los}}}} {3}</string>

In this case it provides translations de la and del for singular nouns, and de las and de los for plural nouns.

@chfo-bidouille

Copy link
Copy Markdown
Contributor Author

Thanks for the explanation.

I've made the changes, hoping they're correct.

In French, the feminine singular is “la,” the masculine singular is “le,” and the feminine and masculine plural is “les.”

But it can also be “de la” for the feminine singular, "du" for the masculine singular, and “des” for the feminine and masculine plural.

For your app, I think the first one is sufficient.

@forrestguice forrestguice added this to the v0.17.2 milestone May 20, 2026
@forrestguice forrestguice merged commit 885ca00 into forrestguice:master May 20, 2026
1 check passed
@forrestguice forrestguice mentioned this pull request May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants