
Table of content
We are continuing our series on localization resource file formats, this time with a closer look at one of the most popular formats, especially since the rise of Ruby/Rails in web development. For those not so familiar with YAML I suggest the very good basic introduction that the Wikipedia article provides.
YAML is a human-readable data serialization format. Its syntax was designed to be easily mapped to data types common to most high-level languages (lists, associative arrays, and scalars). YAML is what we use for localizing LingoHub in our Ruby on Rails application. It has proven to be a very efficient production environment, especially used in conjunction with Github integration which LingoHub supports natively.
Unlike some other formats, YAML has a well-defined standard. Let me outline some key features below followed by an example. As always, feel free to send us questions on these file types or others that you want to use to localize your apps.
Key features of YAML resource file format:
key-value pairs are delimited with colon ( : )
values can be surrounded by quotes
correct and consistent line indentation is important
comments start with a hash sign ( # ), and are ignored by the parser
in the LingoHub context, all comment lines directly preceding a key-value pair (with no blank lines in between) are treated as translation descriptions or LingoCheck rules belonging to that line.
place-holder syntax is: %{name}, where “name” can consist of multiple non-white-space characters
we use UTF-8 encoding for YAML resource files exports by default, but we also support other encodings our users might prefer.
An example of a YAML localization resource file format:
References:
We are continuing our series on localization resource file formats with some other popular file types soon, stay tuned and feel free to post questions below.
Related articles
i18n resource file formats: ini files
Applications on different platforms commonly use .ini files, but no standard exists. We have overviewed the .ini files usage in i18n. Click and learn more details in our blog
i18n resource file formats: iOS .strings files
Read our blog post about localization resource file formats. This article will focus on .strings files, which are widely used in the Apple ecosystem, including on iPhone and iPad devices. Check out our blog for more information
i18n resource file formats: RESJSON files
Learn what RESJSON files are, how they support Windows app localization, and how LingoHub handles syntax, placeholders, comments, and encoding.
i18n resource file formats: RESX and RESW files
Let us know if you need help with RESW/RESX files or Microsoft-specific localization projects. LingoHub provides support for more than 30 different files format, and more will be covered soon