Uncategorized

Using the same iOS and Android keys in multiplatform localization projects

Nick Ustinov,Updated on September 16, 2022·2 min read
Illustration of happy mobile developer

That's a common situation when you are developing your app for two and more platforms - say, iOS and Android, and some key names and values are the same and some are different. Lokalise can help you to avoid double translation work and stay clean in general by automatically merging these keys.

One of the unique features of Lokalise is the ability to have key names exported differently depending on the platform. Coding for different platforms usually involves different naming schemas, for example iOS coders prefer "LoginButton", while Android coders are keen for "login_button". Lokalise has the solution for the never-ending battle. You can enable this feature by going to project Settings and enabling  Per-platform key names option. 

In the following example, follow these easy steps to merge your existing iOS and Android keys.

Start with a blank project. You can either start by uploading iOS keys or Android keys, the sequence does not matter. Next upload second platform's keys to the same project. At this step, Lokalise would link platforms for similar keys, e.g. if your iOS and Android source files contain a key with title login_button the project would end up with one key that is linked to both platforms.

null

If you already have the keys uploaded (or added manually), you would need to do this step manually.

Step 2: Merge by base language translation

In most cases key names would be different and here is how to get them merged by translation. Go to projects view and click small triangle near base language and choose  Show duplicates.

null

This view shows duplicate translations for base language. Lokalise would also analyze the translation field and offers to merge keys, that could be merged.

null

Here are the conditions when keys can be merged:

  • both keys have just one platform assigned
  • both keys have identical translation
  • there is only one key with that translation per platform

The third rule means, that if the translation is similar in more than one key, it cannot be merged, for example if translation Cancel appears on 3 keys Lokalise would not merge them, as that would require modifications in your code (we can only store one key per platform per entry). In order to fix this, you need to delete extra keys of Cancel, update your app code to refer to another key and then merge. 

Feel free to hit  Merge all possible keys button once you've reviewed the list.

Do not mix merging with key referencing. Link button actually creates references, but does not merge the keys.
 
Same procedure applies to merging iOS and Web or Android and Web (or any other combination of platforms).
Uncategorized

Author

nick.jpeg

CIO

Nick is Chief Innovation Officer and former CEO of Lokalise. He’s a serial entrepreneur and was an early internet technology pioneer in Latvia when he founded and developed the first email service – inbox.lv in the late 1990s (which still exists today). While working on one of his recent ventures - Roamer App, he developed a backend to ease localization to different languages which proved to be a product with market demand on its own and later became Lokalise.

What content managers need to know about WordPress localization

WordPress localization: The simplest guide you’ll find

Ten minutes into WordPress localization, and you’re dealing with clunky translations, weird formatting issues, and SEO that just doesn’t work across languages. And let’s not even talk about keeping everything updated without breaking something, including managing localized time accurately across regions. Taking your website global sounds exciting… Until you actually start. The good news is, it doesn’t have to be this complicated<

Updated on March 19, 2025·Rachel Wolff

Stop wasting time with manual localization tasks.

Launch global products days from now.

  • Lokalise_Arduino_logo_28732514bb (1).svg
  • mastercard_logo2.svg
  • 1273-Starbucks_logo.svg
  • 1277_Withings_logo_826d84320d (1).svg
  • Revolut_logo2.svg
  • hyuindai_logo2.svg