Difference between revisions of "HOWTO-Translate ScummVM Web Site"

From ScummVM :: Wiki
Jump to navigation Jump to search
(Update instructions pointing to weblate.)
m (Remove ambox reference)
Line 9: Line 9:
This page contains instructions to translate the ScummVM web site.
This page contains instructions to translate the ScummVM web site.


{{ambox|1=Place notice text here. |heading=Optional heading above the text}}


=== Getting the files to edit ===
=== Getting the files to edit ===

Revision as of 11:32, 20 May 2019

Please read carefully
There have been major changes with website translations. Please read this page before modifying any files. In general Weblate is now used to translate News and site Content (FAQ TBD). DO NOT MODIFY FILES IN I18N directories directly

This page contains instructions to translate the ScummVM web site.


Getting the files to edit

The sources for our web site are available on [github.com]. If you are familiar with GitHub you can clone this scummvm-web repository, make modifications and open a pull request.

Adding a new language to the language menu

Edit the index.php file in the root directory to add an item for your language in the $available_languages array. You can copy one of the existing items as an example.

  • The syntax is the two character language code followed by the language name. For example, to add Hebrew you would write:
    'he' => 'Hebrew',
    

Please keep the languages sorted alphabetically (except for English that comes first).

Translating content and menu items

Translating site content is now handled via Weblate. You can access it here: Translate ScummVM website content This is the component that contains most of the web site strings. If it does not yet exist, you need to add a translation in Weblate.

There are two special strings that need to be set correctly. (locale = and date format =) that are used to automatically translate date.

  • The first one is the [language locale], for example fr_FR.UTF-8 for french from France using UTF-8 encoding.
  • The second is the date format as described [here]. For example "%b %e, %Y" means abbreviated month name followed by the day of the month then a coma and the year coded with 4 digits. This is the format used for news in English and for example gives Dec 25, 2015 in English).

Translating news

Translating news is also handled via Weblate. You can access it here: Translate ScummVM website news

To translate a news article, simply find the relevant strings in Weblate and update them.

To add a new language you'll need to start a new translation in Weblate but also create a directory in the project if it does not already exist. The directory is named after the language code (e.g. fr for French or de for German) in the /data/news/ directory. Inside the directory you'll need to place a .gitignore file set to ignore json files.

Translating the F.A.Q

There is a lot of text in this one! To translate this file you will first to copy the english FAQ file named faq-xml.xml in the data directory to create a file for you language. Add the language code before the extension (e.g. for french the FAQ file is named faq-xml.fr.xml). Then translate the FAQ. Be careful note to translate the XML tags and the href names (they are used in links).