importing_translations.rst 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .. _doc_importing_translations:
  2. Importing translations
  3. ======================
  4. Games and internationalization
  5. ------------------------------
  6. The gaming community isn't monolingual or monocultural. It's made up of
  7. many different languages and cultures - just like the Godot community!
  8. If you want to allow players to experience your game in their language,
  9. one of things you'll need to provide is text translations, which Godot
  10. supports via internationalized text.
  11. In regular desktop or mobile applications, internationalized text is
  12. usually located in resource files (or .po files for GNU stuff). Games,
  13. however, can use several orders of magnitude more text than
  14. applications, so they must support efficient methods for dealing with
  15. loads of multilingual text.
  16. There are two approaches to generate multilingual language games and
  17. applications. Both are based on a key:value system. The first is to use
  18. one of the languages as the key (usually English), the second is to use a
  19. specific identifier. The first approach is probably easier for
  20. development if a game is released first in English, later in other
  21. languages, but a complete nightmare if working with many languages at
  22. the same time.
  23. In general, games use the second approach and a unique ID is used for
  24. each string. This allows you to revise the text while it is being
  25. translated to other languages. The unique ID can be a number, a string,
  26. or a string with a number (it's just a unique string anyway).
  27. Supported formats
  28. -----------------
  29. To complete the picture and allow efficient support for translations,
  30. Godot has a special importer that can read CSV files. Most spreadsheet
  31. editors can export to this format, so the only requirement is that the
  32. files have a special arrangement. See
  33. :ref:`doc_localization_using_spreadsheets` for detailed info on
  34. formatting and importing CSVs.
  35. If you need a more powerful file format, Godot also supports loading
  36. translations written in the gettext ``.po`` format. See
  37. :ref:`doc_localization_using_gettext` for details.