Skip to content

translations.txt: specify which translation takes precedence over another#327

Merged
sccmcca merged 1 commit intogoogle:masterfrom
timMillet:translations-precedence
Jun 2, 2022
Merged

translations.txt: specify which translation takes precedence over another#327
sccmcca merged 1 commit intogoogle:masterfrom
timMillet:translations-precedence

Conversation

@timMillet
Copy link
Contributor

Current issue

Translations can be defined in two ways using translations.txt:

  • By referring to a particular row using record_id and record_sub_id;
  • By referring to a particular value using field_value;

The specification does not forbid translating the same value twice, using both referencing methods. In which case, there is no stated logic over which translation should take preference. This leads to a situation where the data consumer needs to make a discretionary choice, behavior that is not desired. Example:

routes.txt

route_id,route_short_name
route_id_1,subway

translations.txt

table_name,field_name,language,translation,record_id,record_sub_id,field_value
routes,route_short_name,fr,métro,route_id_1,,
routes,route_short_name,fr,train,,,subway

Solution in this PR

The translation made with the referencing method (record_id, record_sub_id) takes precedence.

@westontrillium
Copy link
Contributor

Instead of establishing a hierarchy, wouldn't it be simpler to forbid translating the same value in one language twice? Is there a use case for doing so?

@timMillet
Copy link
Contributor Author

@westontrillium What you suggest could be another solution and we thought about that. We preferred establishing a hierarchy because it’s a simple rule, it’s efficient because you can give a general translation that you can override in special cases, and it still meets the requirement of being unambiguous / not discretionary.

@sccmcca sccmcca added the GTFS Schedule Issues and Pull Requests that focus on GTFS Schedule label May 17, 2022
@timMillet
Copy link
Contributor Author

It looks like the proposal does not raise any other concerns. I’m opening a vote on this PR.

  • translations.txt is already produced and consumed (see the original PR#180). Transit is interested in consuming it once this PR is accepted.
  • Voting ends on 2022-06-02 at 23:59:59 UTC.

NB: The vote is also open on PR#326 which fixes another issue in translations.txt.

@npaun
Copy link
Contributor

npaun commented May 26, 2022

+1 Transit.

@brodyFlannigan
Copy link

+1 Brody Flannigan Transit Data

@sccmcca sccmcca added the Vote to Test Community votes to determine whether the proposal is ready for testing. label May 26, 2022
@westontrillium
Copy link
Contributor

+1 Trillium

@laurentg
Copy link

laurentg commented Jun 1, 2022

+1 Mecatran

@botanize
Copy link
Contributor

botanize commented Jun 2, 2022

+1 Metro Transit

@timMillet
Copy link
Contributor Author

The voting period has ended. With 5 votes in favor and no votes against, this proposal is adopted.
Thanks to anyone who participated and voted!

@sccmcca sccmcca removed the Vote to Test Community votes to determine whether the proposal is ready for testing. label Jun 2, 2022
@sccmcca sccmcca merged commit e00cc3c into google:master Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GTFS Schedule Issues and Pull Requests that focus on GTFS Schedule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants