Difference between revisions of "HOWTO-Translate ScummVM Web Site"
(Initial instructions to translate the web site) |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{| border="0" cellpadding="1" cellspacing="2" style="margin-left:5em; background:#FF9999; width:80%" | |||
|- align="center" | |||
| '''Please read carefully''' | |||
|- style="margin-left:1em; background:#ffffff;" | |||
|- style="background:#ffffff" | |||
|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. | This page contains instructions to translate the ScummVM web site. | ||
=== Getting the files to edit === | === Getting the files to edit === | ||
The sources for our web site are available on [[https://github.com/scummvm/scummvm-web github.com]]. If you are familiar with GitHub you can clone this scummvm-web repository, make modifications and open a pull request | The sources for our web site are available on [[https://github.com/scummvm/scummvm-web 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 === | === Adding a new language to the language menu === | ||
Edit the '' | 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 language code | * The syntax is the two character language code followed by the language name. For example, to add Hebrew you would write: <syntaxhighlight lang="php">'he' => 'Hebrew',</syntaxhighlight> | ||
Please keep the languages sorted alphabetically (except for English that comes first). | Please keep the languages sorted alphabetically (except for English that comes first). | ||
=== Translating | === Translating content and menu items === | ||
This is the | Translating site content is now handled via Weblate. You can access it here: [https://translations.scummvm.org/projects/scummvm-website/content/ 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 [[https://en.wikipedia.org/wiki/Locale#POSIX_platforms language locale]], for example ''fr_FR.UTF-8'' for french from France using UTF-8 encoding. | * The first one is the [[https://en.wikipedia.org/wiki/Locale#POSIX_platforms language locale]], for example ''fr_FR.UTF-8'' for french from France using UTF-8 encoding. | ||
* The second is the date format as described [[http://php.net/manual/en/function.strftime.php 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 | * The second is the date format as described [[http://php.net/manual/en/function.strftime.php 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 | === Translating news === | ||
Translating news is also handled via Weblate. You can access it here: [https://translations.scummvm.org/projects/scummvm-website/news/ Translate ScummVM website news] | |||
To translate a news article, simply find the relevant strings in Weblate and update them. | |||
To | 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 === | === 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. | 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). |
Latest 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.
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 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).