Home | Resources | Blog

What Are Localization Files and How to Use Them?

In software localization projects, translatable strings are first collected in so-called “localization files” or “resource files.” These files are then handed off to translators who translate strings and thereby create copies of the original files now containing equivalent strings in a different language. They return their translation files to the developers who integrate them into the software. Thus, resource files are a crucial component of the localization process.

What are localization files?

Localization files can be super simple or fairly complex. In all cases, though, we are dealing with plain text files. This means they are typically easy to create and can – in principle – be edited in a common text editor.

In the simplest case, a resource file contains text strings, one on each line, each preceded with a unique ID – the “translation key.” More complex files may in addition contain a target language string for each source string, making the file bilingual. For each string, the file may also contain comments, keywords or tags, context indicators, and pluralized variants. And instead of a simple one-dimensional list, the file might contain strings organized in a hierarchical structure.

Once the file format reaches a certain level of complexity, a simple text editor begins to lose its utility. Very complicated files are best edited with applications that understand the structure and can present the information in an understandable manner.

How are localization files created?

The software localization process begins with a step called internationalization. The developer modifies here the source code and extracts keys for localization. This means that all displayable text snippets (“strings”) are removed from the code and replaced with a unique ID (“key”). The keys and their strings are then added to a resource file.

The running software continually queries the resource file and when it needs to display some text, it uses the key provided in the code to pull the appropriate string from the file. When the user selects a different display language, the software then redirects and pulls strings from the resource files for that specific language.

While some programming environments (Visual Studio for example) have tools to automate the string extraction, the developer needs to mark displayable strings by hand in most cases. Tools like gettext can then pull all marked strings into resource files. The exact method and the preferred resource file format depend on the programming language and development environment.

What are common localization source file formats?

Linux developers are likely familiar with Translate Toolkit and the gettext utility. Both mainly work with PO files (and their space-saving binary equivalents, POTfiles). PO files are of medium complexity, because “translation units” span several lines and files may contain meta-information about each string as well as pluralized variants. The advantage of working with PO is that it is a very common format and there are many tools and utilities to work with them. However, loading a PO file into software can be a challenge, especially if developers work with newer programming languages that do not have specific parsers (yet).

For easy and speedy development, programmers often choose to forego the complexities of PO files and opt for simpler formats, such as YAML. This is a very straightforward file type, with one key-string pair per line. A format that is very easy to read and write – any programmer can write relevant routines in a few lines of code. But it does not contain a lot of information that could help the translator.

JSON-based formats have the same appeal for programmers – they are easy to read and easy to generate. JSON is an information interchange format that most programming languages support. Thus, it is a useful format for development environments with a mix of programming languages. JSON allows to add as much meta information as desired, but any added complexity reduces the value of JSON as the lowest common denominator format: complex structures require complex code to handle them.

While YAML and JSON are formats that primarily serve for exchanging data between software programs and/or development tools, XLIFF is an exchange format for translation tools. XLIFF is a translation industry standard that most if not all translation and localization programs support. This is an XML-based format, which means it uses <tags> for separating and identifying pieces of content.

Finally, some tools use CSV or XLSX as resource file formats. The benefit of these is that they can be opened, inspected, and edited with a familiar spreadsheet program. That’s why these formats are useful for exchanging information with people who do not have access to either development or translation tools.

Thus, localization file formats differ because they are used with slightly different intents. Typically, those are the intents of the programmers who created a development tool, and developers and localizers may not have much of a choice once they work in a specific development environment.

What are some advanced features in localization files?

If localization file formats allow for complexity, someone is guaranteed to increase the complexity of their data. With most formats, developers have some freedom to pack information into the translation key and use it to tell where exactly a string is used. Most formats also provide ways to add comments or explanations for the translator. In PO files, Android XML, and iOS strings files, among others, developers can insert both singular and plural versions of strings and thereby give translators the opportunity to provide different wordings for each. JSON files can encode deeply nested structures and thus reflect the dependency relationships of display screens in a software program.

One caveat here: if a format offers you the option to use complex structures, it is not necessarily a good idea to make use of it. Pluralizations from one language do not always have direct equivalents in other languages, and making appropriate modifications to the localization file is not a trivial task. Comments in localization files are only useful if the translator can see them – and they only see them if their translation tool can show them. Likewise, if keys hold crucial information, it is crucial that translation tools provide ways to use it. Nested structures are most problematic: since these require specific decoders, it is extremely unlikely that a translation tool can display this information in a meaningful way. ‘

Therefore, if you know that your localization files contain information besides just translatable strings, it is worth pointing this out to your translation team.

How do you best manage localization resource files?

As with localization formats themselves, the way localization files are organized may be dictated by the tools you use for development.

Some tools use monolingual files and maintain translations in files with the same names but added language suffixes. Other tools use bilingual or even multilingual files, which means that all source and target strings that belong together automatically stay together.

Some environments encode dependencies inside their localization files while others create subfolder structures for the same purpose.

Each aspect has its advantages and disadvantages. For example, while multilingual files may be easy to work with for the programmer, they pose a challenge when you want different translators to work on them simultaneously.

If you have control over the choice of localization format, the complexities inside the files, and the way resource files are named and organized, the best practice would be to hold off any decisions until you have discussed it with your localization team. Your localization tool may steer you in a specific direction, or it may offer surprising features and conveniences to you.

Keep exploring

SOC 2 Type 2 image

Blog post

SOC 2 Type 2 at Phrase: what it means for your localization data

A new product name, a contract, an earnings release, a campaign that hasn’t launched yet. Before any of it reaches people in another language, it passes through a translation workflow, often before the public has seen a word. Along the way it may meet translators, reviewers, language service providers and machine translation engines. So it’s […]

Professional woman in glasses studying a digital screen showing a global localization workflow diagram with connected content icons and world map The Craft Beer Enthusiast's Guide to Home Brewing Chapter 1: Introduction to Home Brewing Welcome to the world of home brewing, where you can create your own unique craft beers right in your kitchen or garage. This guide is designed for beginners who are passionate about craft beer and want to try their hand at making their own. We'll walk you through the entire process, from selecting ingredients to tasting your final product. Home brewing is both an art and a science. It requires patience, attention to detail, and a willingness to experiment. But don't be intimidated – people have been brewing beer for thousands of years, and with the right guidance, you can produce a delicious product on your first try. Chapter 2: Understanding Beer Styles Before you start brewing, it's important to understand the different types of beer you can make. The two main categories are ales and lagers, which differ based on the type of yeast used and the fermentation temperature. Ales are fermented at warmer temperatures (60-75°F) using top-fermenting yeast, which rises to the top of the beer during fermentation. This process typically takes less time than lager brewing. Common ale styles include: - India Pale Ale (IPA): Known for their hoppy flavor and aroma - Stout: Dark, rich beers often with notes of coffee or chocolate - Wheat beer: Light, refreshing beers brewed with a significant proportion of wheat - Amber ale: Medium-bodied beers with a balance of malt and hops Lagers are fermented at cooler temperatures (35-50°F) using bottom-fermenting yeast. They generally have a cleaner, crisper taste and require a longer fermentation period. Common lager styles include: - Pilsner: Light-colored, crisp beers with a moderate hop bitterness - Märzen/Oktoberfest: Medium-bodied, amber-colored beers with a rich malt character - Bock: Strong, full-bodied beers with a malty sweetness For beginners, ales are often recommended because they ferment at room temperature and are quicker to produce. Chapter 3: Essential Equipment To start home brewing, you'll need some basic equipment. Here's a list of what you'll need: 1. Brew kettle: A large pot (at least 5 gallons) for boiling your wort (the liquid extracted from the mashing process) 2. Fermenter: A vessel where your beer will ferment. This can be a plastic bucket or glass carboy 3. Airlock: A device that allows CO2 to escape during fermentation while preventing air from entering 4. Auto-siphon and tubing: For transferring your beer between vessels 5. Bottle capper and caps: For sealing your finished beer in bottles 6. Hydrometer: A device for measuring the specific gravity of your beer, which helps you calculate alcohol content 7. Sanitizer: Essential for keeping all your equipment clean and free of bacteria that could spoil your beer 8. Thermometer: For monitoring temperatures throughout the brewing process You can find all these items at your local home brewing store or online. Many shops offer starter kits that include everything you need to begin brewing. Chapter 4: Ingredients Beer is made from four main ingredients: water, malt, hops, and yeast. Understanding these ingredients is key to creating great beer. Water makes up about 90% of beer, so the quality and mineral content of your water can significantly impact the flavor of your brew. If your tap water tastes good, it's generally fine for brewing. If not, consider using filtered or bottled water. Malt provides the sugars that yeast will ferment into alcohol. It also contributes color, body, and flavor to your beer. For beginners, malt extract (available in liquid or dry form) is the easiest to work with as it eliminates the need for a mashing process. Hops are flower cones from the hop plant that add bitterness, flavor, and aroma to beer. They also act as a natural preservative. Hops come in many varieties, each with its own unique flavor profile. Some popular varieties include: - Cascade: Floral, citrusy, often used in American Pale Ales and IPAs - Saaz: Earthy

Blog post

Why most CMOs aren’t ready for the role AI is creating

AI is changing what it means to lead marketing. As more work moves into connected systems, CMOs need to understand how those systems learn, retain knowledge and apply market context. Joshua Spanier, VP of AI and Marketing Strategy at Google, argues that CMOs need to engage with the technology themselves and think beyond isolated tools toward connected systems that retain knowledge and inform decisions across teams and markets. This article looks at what that means for the CMO role as AI takes on more of the work.

In Other Words podcast graphic featuring Joshua Spanier, Google VP AI & Marketing Strategy, and Raja Rajamannar, Former CMCO at Mastercard

Blog post

How global marketing leaders can prove impact across markets

Google found that creator ads worked. Product ads worked too. Put them together, and paid social effectiveness climbed from below 7% to 70%. The two-voice model offers a useful lesson for CMOs rethinking how creator content fits into the wider media mix.

Woman at laptop surrounded by AI icon and colorful language code bubbles — en, es, de, it, zh — with "Quality" text and speed light trails on dark background.

Blog post

The riskiest AI translation is the one that looks right

I get asked a lot whether AI has solved localization.  It’s almost a redundant question. Some content can now go out without anyone checking it. But translation as a whole is still an unsolved problem. The hard part is convincing anyone, because of what I call the blind effect.You run a product page through a […]

FI- The two-voice model that helped take google’s paid social

Blog post

The two-voice model that helped take Google’s paid social from 7% to 70%

Google found that creator ads worked. Product ads worked too. Put them together, and paid social effectiveness climbed from below 7% to 70%. The two-voice model offers a useful lesson for CMOs rethinking how creator content fits into the wider media mix.