Translating¶
Silverdash360 can be shown in any language there's a translation for. It keeps its text as the console's own apps do (Viaplay's, for one): English is built into Silverdash360.dll, and each translation is a Strings.<language>.resources file beside default.xex. A string a translation doesn't have yet is shown in English.
It has translations into every language the Xbox 360's own dashboard has, and seven more:
| The dashboard's | Chinese (Simplified and Traditional), Dutch, French, German, Italian, Japanese, Korean, Norwegian, Polish, Portuguese (Brazil and Portugal), Russian, Spanish (Latin America and Spain), Swedish, Turkish |
| More | Czech, Danish, Finnish, Greek, Hungarian, Slovak, Ukrainian |
They were made by machine translation, so they want a native speaker's eye: corrections are very welcome (see Making a translation).
Which language is shown¶
Language in settings, and on the welcome screen, picks it. Same as the console, the default, picks it as the console's own apps do:
- The language of the console's locale, for Sweden and Norway, and for the countries whose language the console has no menus in: Swedish, Norwegian, Danish, Finnish, Greek, Hungarian, Slovak or Czech when the console is set to Sweden, Norway, Denmark, Finland, Greece, Hungary, Slovakia or the Czech Republic, whatever its language. The console has no Ukraine, so Ukrainian is picked in Language, in the settings.
- The console's language with its country, such as
pt-brfor Portuguese in Brazil, then the language alone (pt). - English, when there's no translation for any of them.
Picking another language starts Silverdash360 again in it. The language picked is kept with the other settings; a translation that's no longer there falls back to the console's.
The controls that come with the Silverlight platform, such as the video player's bar, follow the same language, from the runtime's Microsoft.Xbox.Strings.<culture>.resources. The runtime has them in 18 languages: Danish, Dutch, English, Finnish, French (France and Canada), German, Italian, Japanese, Korean, Norwegian, Polish, Portuguese (Brazil), Russian, Spanish (Spain and Mexico), Swedish and Chinese (Hong Kong). See The platform's strings for others.
Making a translation¶
The strings are in src/Silverdash360/Strings. Strings.resx is English. A translation is a copy of it named for its language:
-
Copy
Strings.resxtoStrings.<code>.resx, such asStrings.fi.resx. The code is the language's, in lower case:fi,de,pt-br. Silverdash360 looks for these:arbgcacsdadeelen-gbeses-eses-mxetfifrfr-cahehrhuidisitjakoltlvnbnlplptpt-brpt-ptroruskslsrsvthtrukvizh-hanszh-hantzhAnother needs adding to
Knowninsrc/Silverdash360/Core/Languages.cs. -
Translate each
<value>, and leave thenames as they are. Each string's<comment>says where it shows, when that isn't plain. Strings you leave out are shown in English, so a translation can be done a part at a time. Language.Nameis the language's name for itself, as the language list shows it:suomi,Deutsch(with a capital letter only where the language writes one).
Regional variants¶
Where a language differs between countries, one file is the language in full and another, named for its country, has only what that country says differently. Each string of the country's file comes before the language's, and the language's before English:
| File | |
|---|---|
Strings.es.resx |
Spanish, as Latin America writes it |
Strings.es-es.resx |
What Spain says differently: vídeo for video |
Strings.pt.resx |
Portuguese, as Brazil writes it |
Strings.pt-pt.resx |
What Portugal says differently: ecrã for tela, ficheiro for arquivo |
A console set to a country picks its file, so a Spanish console in Spain shows es-es over es, and one in Mexico or Argentina es. Each file's Language.Name names its variant, as the language list shows them: español (España), español (Latinoamérica). Put in a country's file only the strings that differ, and its Language.Name; tools/strings.py check says how many it has of its own.
What to keep as it is:
{0},{1}and so on, the values put in: a name, a size, a count. They can move within the sentence.- In the button legends at the bottom of a page (
A select B back), the buttons' names:A,B,X,Y,LB,RB,LT,RT,STARTandBACK. Each item starts with its buttons, and three spaces part the items:A valitse B takaisin. Controls.Keyboard.Lettersis the search keyboard's keys, in order, ten to a row: your language's letters, then the digits, such asABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ0123456789for Finnish or Swedish. Search ignores accents, so plain letters find accented names too, and Y on the search page opens the console's own keyboard for anything else.Format.DateandFormat.DateTimeare how a date is written, in .NET's custom format:dd.MM.yyyyanddd.MM.yyyy HH:mmfor Finnish. Leave the letters for the parts (dd,MM,yyyy,HH,mm) and change the order and what's between them.
A string for a count has a key for each form the count takes: .One and .Other in English ({0} title, {0} titles). A language can have others:
| Language | Forms |
|---|---|
| Most, such as German, Finnish, Swedish, Spanish, European Portuguese | .One (1), .Other |
| French, Brazilian Portuguese | .One (0 and 1), .Other |
| Japanese, Korean, Chinese, Turkish | .Other only |
| Polish | .One (1), .Few (2 to 4, 22 to 24...), .Many (the rest) |
| Russian, Ukrainian | .One (1, 21, 31...), .Few (2 to 4, 22 to 24...), .Many (the rest) |
| Czech, Slovak | .One (1), .Few (2 to 4), .Other |
Add the forms your language needs, such as Shelf.Titles.Few; one it doesn't have uses .Other.
Trying it¶
Without building, tools/strings.py makes the file Silverdash360 reads:
python tools/strings.py compile src/Silverdash360/Strings/Strings.fi.resx
Copy the Strings.fi.resources it writes into Silverdash360's folder on the console, beside default.xex (over FTP, for one), start Silverdash360 again and pick the language under Settings > Language.
A build puts every translation in the package by itself (.\tools\Build.ps1), and releases have them, so an update brings them too.
Check a translation before sending it in:
python tools/strings.py check
It says when a translation has a key English hasn't, or a string with other {0}s than English's, and how many strings are still in English. For developers, it also checks that every key the code uses is in Strings.resx, and every one there is used.
Send a translation as a pull request (see Contributing), or attach it to an issue.
The platform's strings¶
The platform's controls have their own strings, the runtime's Microsoft.Xbox.Strings.<culture>.resources. They're Microsoft's, from the donor app, so they aren't in the repository, but translations of them can be: put them in src/Silverdash360/Strings/Microsoft.Xbox as Microsoft.Xbox.Strings.<culture>.resx, with a language and a country, such as cs-cz or pt-pt. The build puts them in the package beside the runtime's, and one for a culture the runtime has comes before the runtime's.
To start one from the runtime's English, with your runtime profile built:
python tools/strings.py sdk <Silverlight360>\runtime\plex-2015\package
It writes Microsoft.Xbox.Strings.en-us.resx into src/Silverdash360/Strings/Microsoft.Xbox/base, which git ignores. Copy it out of base, rename it for the culture and translate it. Leave the keys ending in Runes, the letters the platform's own keyboard control offers, as letters: add your language's to them (abcdefghijklmnopqrstuvwxyzåäö).
The controls pick the culture of the language shown with the console's country first (pt-br on a Brazilian console), then the language's usual one (fi-fi), then en-us.
The platform's debug strings, the messages of the exceptions its controls throw, stay in English. The runtime reads them from Microsoft.Xbox.DebugStrings.resources alone, and doesn't let an app pick another language for them. They show only in logs. tools/strings.py sdk writes them into base too, as Microsoft.Xbox.DebugStrings.resx, to read.
Testing that everything is translated¶
tools/strings.py pseudo writes a test language, qps: every string in English, in brackets, with accents. Text that shows without them on a page wasn't moved into the strings. After a Debug build:
python tools/strings.py pseudo src/Silverdash360/bin/Debug/xbox
writes it into the package, with the platform's controls in it too, so .\tools\Run.ps1 -Install and tools\deploy.py take it along; pick Pseudo [qps] under Settings > Language. The debug server's lang.state says which language is shown and how many strings it has, and lang.pick <code> picks one for the next start.
Reviewing a translation¶
tools/Screenshots.ps1 -Review takes a translation's screens in xenia, with the test library on the shelves, and checks each for text that doesn't fit: wider than the room it has, so it's cut off at the edge. After a Debug build:
.\tools\Screenshots.ps1 -Languages en,fi -Review
It puts the screens side by side, English first, in index.html in its folder (%TEMP%\silverdash-screenshots\review), with each text that doesn't fit listed under its screen and its string's key, such as Settings.FileBrowser.Detail, and all of them at the top. Make such a string shorter. The debug server's ui.clipped does the same check on whatever is on the screen, on a console too, for the screens xenia can't show, such as System settings.
Chinese, Japanese and Korean¶
The console's Silverlight runtime has fonts for Japanese and Korean (Xbox JK) and Traditional Chinese (Xbox TC), but not Simplified Chinese. Silverdash360 shows Simplified Chinese in Noto Sans SC (SIL Open Font License), cut down to the characters its strings use, in src/Silverdash360/Assets/Fonts. After the Simplified Chinese strings change, make it again from Noto Sans SC (ofl/notosanssc in Google Fonts):
python tools/cjk_font.py NotoSansSC[wght].ttf
tools/strings.py check says when a string has a character the font hasn't.
Translating the docs¶
These pages can be in other languages too: a translation of a page sits beside it, named for its language, as docs/install.es.md is docs/install.md in Spanish, published at /es/install/. Home, Installing and Updating are in every language the app is, with Spanish and Portuguese as one each (Chinese is zh_TW and zh_CN here: the site's theme takes only letters and _ in a language's name). Keep a translated page's links as the English page's (install.md, images/home.webp): they go to the page in the same language where there's one, and to the English page where there isn't. Name what's on screen as the app's translation does. A language the site doesn't have yet is added to the i18n plugin's languages in mkdocs.yml, with its navigation's names, and the theme's words (Search docs, Previous, Next...) to tools/docs_theme_words.json for a language the theme hasn't them all in.
The screenshots on a translated page are in its language: images/home.es.webp in place of images/home.webp. tools/Screenshots.ps1 takes them in xenia, with the test library on the shelves, after a Debug build:
.\tools\Build.ps1 -Debug
.\tools\Screenshots.ps1 -Languages es,pt