What are Strings, Keys, and Language Codes?
Translating a software product involves several important concepts to ensure that the software can be used smoothly in different languages and regions.
When localising a software product, each piece of text needs a unique identifier, a name. This identifier is called a key. Keys let you manage and reference text separately from your products code, while making it really easy to reference the right piece of text in the code.
• Keys: Unique names given to each piece of text.
• Strings: The actual pieces of text that users see.
The beauty of this setup is that you can link multiple strings to a single key, with each string in a different language. This way, your software can speak many languages without breaking a sweat.
Using keys to refer to strings makes it a breeze to edit and manage text across languages, all without touching the core code or getting tangled up with the actual text values.
↓ If you want to know a bit more
What is a Key?
A key is a label used to identify a piece of text in the software. Instead of writing the actual text directly into the software, a key acts like a placeholder.
For example, instead of putting “Welcome” directly into the software, you might use a key like “welcome_message”. This key will be linked to the actual text in different languages.
What is a String?
A string is simply a piece of text that appears in the software. In localisation, strings are the actual words or sentences that need to be translated. Each string is connected to a key.
For example, you might have a string for the key “welcome_message” that says “Welcome” in English and “Bienvenido” in Spanish. These strings are usually stored in separate files for each language.
What is a Language Code?
A language code is a short code that represents a specific language. These codes help the software know which language to display. For example:
• en stands for English
• es stands for Spanish
• fr stands for French
Sometimes, language codes are combined with country codes to be more specific, like en-US for American English or en-GB for British English.
Each string has an associated language code, so it can be loaded correctly based on the user’s language settings. This ensures that users see the text in their preferred language, providing a seamless and personalized experience.