BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

Cross-project synchronization of translations

Open Jeehut opened this issue 4 years ago • 0 comments

Often times, multiple projects with overlapping translations are developed within one company. This could be multiple apps where some of the translations overlap or simply an Android version of the same app. In both of these cases, it could be possible to somehow synchronize the translations for consistency.

Note that there are different approaches one could take here. The approach taken should be safe and very unlikely to destroy translation processes. For example, the following should be considered:

  1. When comparing keys, different key systems should be converted to a normalized system, e.g. the typical android key style onboarding_page_one_title should match with ONBOARDING.PAGE_1.TITLE
  2. For each translation, there should be a history of the changes looked up (via git) and only if the translations were similar and only one side has changed, the change should be applied on the other side as well.
  3. Whenever Bartycrouch is executed and does such changes, the change and the reason & source for the change should be documented, both in a changelog-style file on the machine and also in the next git commit message's comment (if needed, an automatic commit-mode should be implemented and recommended when synchronizing translations).
  4. Beware that on Android there are many special cases to be normalized away from the comparison string, like these:
<string name="global.duration.time_interval"><xliff:g example="14:00" id="from">%1$s</xliff:g> – <xliff:g example="16:00" id="to">%2$s</xliff:g></string>
<string name="notifications_workout_reminders_today_message">It\'s time for a workout! &#128170; You can do it. &#128521;</string>
<string name="statistics.body_mass_index.explanation"><![CDATA[
            The classical index derived from weight & height of a person to serve as an indicator for under-/overweight.
            Does not take into consideration the age, gender or body fat of a person.
        ]]></string>

Jeehut avatar Feb 06 '20 07:02 Jeehut