Translations
This document outlines how administrators can manage translations for both the public-facing website (content sourced from Sanity CMS) and the internal dashboard application.
Translations for Website (via Sanity CMS)
Administrators typically do not directly manage website translations within the DistroMotion admin panel. Content for the public website, including its various language versions, is managed through Sanity CMS.
Process Overview (Simplified for Admins):
- Content Creation/Update in Sanity: New content or updates to existing content are made in the primary language within Sanity CMS.
- Translation Workflow in Sanity: Sanity CMS usually has built-in features or integrations with third-party services to manage the translation of this content into different languages.
- Publishing: Once translated and reviewed within Sanity, the content is published, making the different language versions available on the live website.
Admin’s Role:
- Ensure that content editors and translators are aware of the process for managing multilingual content in Sanity CMS.
- Coordinate with the team responsible for Sanity CMS to understand the status of translations and any issues.
- Verify that the website correctly displays the different language versions once published from Sanity.
For detailed instructions on managing translations within Sanity CMS, please refer to the Sanity CMS documentation or contact the team responsible for its administration.
Translations for Dashboard
The Translations page within the DistroMotion staff admin panel allows administrators to manage language translations specifically for the dashboard interface. This ensures that staff members who speak different languages can use the dashboard effectively.
Internal Logic:
The dashboard uses a key-value system for translations. Each piece of text in the interface (e.g., a button label, a table header, a notification message) is associated with a unique “key.” The translation process involves providing the corresponding text (the “value”) for each key in every supported language.
When an administrator imports a translation file, the system parses this file and updates its internal translation database. When a staff member uses the dashboard, the system looks up the appropriate translated string for their selected language using these keys.
Finding Global Language Codes
For reference check at the bottom of the page.
Template
The downloaded template provides a structured format for adding or updating translations. It usually includes columns like translation key, source text, and translated text for each language.
- Download Template: This button allows users to download a template Excel file for translation purposes. The template helps in standardizing the format for importing translations.
- Import Translations: This button opens a modal for uploading completed translation templates.
Import Translations
When you click on the Import Translations button, a modal appears where you can upload your completed translation template. The modal includes the following fields:
- Language Code: A text field where you need to input the language code (e.g.,
enfor English). - Language Name: A text field for specifying the language name (e.g.,
English). - Choose File: A file upload field where you can select the completed translation template file.
Buttons:
- Cancel: Closes the modal without making any changes.
- Import: Confirms the import of the selected file and processes it.
Page Sections and Features
The table on the page displays the list of translations with the following columns:
- ID: A unique identifier for the translation.
- Language Code: The code representing the language (e.g.,
enfor English,hi_INfor Hindi,GJ_ENfor Gujarati). - Description: A brief description of the language or translation context.
- Status: Indicates if the translation is active or inactive.
- Details: A link to view further details about the specific translation.
- Completed Keys: The number of completed translation keys out of the total available.
- Completion %: The percentage of completed translation work.
- Created: The date when the translation was created.
- Updated: The most recent date when the translation was updated.
- Actions: Actions that can be performed on the translation (e.g., Deactivate).
Here’s dynamic and common documentation for the detailed translation view page:
Translation Details Page
The Translation Details page allows users to view and edit specific translation fields for a selected locale. This page is accessible by clicking the View link for a language on the main Translations page. It includes a set of fields where users can modify, copy, or reset default values for translation purposes.
Navigation Tabs
- The page includes tabs representing various sections or categories of the application (e.g., Root 100, Homepage 86, Youtube Mcn 100, Rights Admin 5, etc.).
- Each tab displays the number of completed keys related to that section.
- Clicking on a tab shows the translation details specific to that category.
How to Use
- Navigate to the specific section by clicking the corresponding tab.
- Review each field and its default value.
- Edit the translation as needed by typing into the input box.
- Use the Copy button for quick entry of the default value, if necessary.
- Click Save Draft to keep changes without publishing or exporting them.
Field Structure
Each section contains translation fields with the following elements:
- Field Name: A label identifying the translation key (e.g., Warning Alert Dialog Title).
- Input Box: A text field where users can enter or edit the translation text.
- Default Value: The original or fallback translation text provided for context (e.g., Default Value - Warning from Distromotion).
- Copy Button: A button allowing users to copy the default value into the input field.
- Status Icons: Indicators (such as icons or characters) that represent the state of the input (e.g., translated, untranslated, etc.).
- Copy Default Values to All Fields: This button populates all input fields with their respective default values for ease of use.
- Save Draft: Saves the current state of the translations without publishing them.
Language Codes
| Code | Language |
|---|---|
| af | Afrikaans |
| sq | Albanian |
| an | Aragonese |
| ar | Arabic (Standard) |
| ar-dz | Arabic (Algeria) |
| ar-bh | Arabic (Bahrain) |
| ar-eg | Arabic (Egypt) |
| ar-iq | Arabic (Iraq) |
| ar-jo | Arabic (Jordan) |
| ar-kw | Arabic (Kuwait) |
| ar-lb | Arabic (Lebanon) |
| ar-ly | Arabic (Libya) |
| ar-ma | Arabic (Morocco) |
| ar-om | Arabic (Oman) |
| ar-qa | Arabic (Qatar) |
| ar-sa | Arabic (Saudi Arabia) |
| ar-sy | Arabic (Syria) |
| ar-tn | Arabic (Tunisia) |
| ar-ae | Arabic (U.A.E.) |
| ar-ye | Arabic (Yemen) |
| hy | Armenian |
| as | Assamese |
| ast | Asturian |
| az | Azerbaijani |
| eu | Basque |
| bg | Bulgarian |
| be | Belarusian |
| bn | Bengali |
| bs | Bosnian |
| br | Breton |
| my | Burmese |
| ca | Catalan |
| ch | Chamorro |
| ce | Chechen |
| zh | Chinese |
| zh-hk | Chinese (Hong Kong) |
| zh-cn | Chinese (PRC) |
| zh-sg | Chinese (Singapore) |
| zh-tw | Chinese (Taiwan) |
| cv | Chuvash |
| co | Corsican |
| cr | Cree |
| hr | Croatian |
| cs | Czech |
| da | Danish |
| nl | Dutch (Standard) |
| nl-be | Dutch (Belgian) |
| en | English |
| eo | Esperanto |
| et | Estonian |
| fo | Faeroese |
| fa | Farsi |
| fj | Fijian |
| fi | Finnish |
| fr | French (Standard) |
| fr-be | French (Belgium) |
| fr-ca | French (Canada) |
| fr-fr | French (France) |
| fr-lu | French (Luxembourg) |
| fr-mc | French (Monaco) |
| fr-ch | French (Switzerland) |
| fy | Frisian |
| fur | Friulian |
| gd | Gaelic (Scots) |
| gd-ie | Gaelic (Irish) |
| gl | Galacian |
| ka | Georgian |
| de | German (Standard) |
| de-at | German (Austria) |
| de-de | German (Germany) |
| de-li | German (Liechtenstein) |
| de-lu | German (Luxembourg) |
| de-ch | German (Switzerland) |
| el | Greek |
| gu | Gujurati |
| ht | Haitian |
| he | Hebrew |
| hi | Hindi |
| hu | Hungarian |
| is | Icelandic |
| id | Indonesian |
| iu | Inuktitut |
| ga | Irish |
| it | Italian (Standard) |
| it-ch | Italian (Switzerland) |
| ja | Japanese |
| kn | Kannada |
| ks | Kashmiri |
| kk | Kazakh |
| km | Khmer |
| ky | Kirghiz |
| tlh | Klingon |
| ko | Korean |
| ko-kp | Korean (North Korea) |
| ko-kr | Korean (South Korea) |
| la | Latin |
| lv | Latvian |
| lt | Lithuanian |
| lb | Luxembourgish |
| mk | FYRO Macedonian |
| ms | Malay |
| ml | Malayalam |
| mt | Maltese |
| mi | Maori |
| mr | Marathi |
| mo | Moldavian |
| nv | Navajo |
| ng | Ndonga |
| ne | Nepali |
| no | Norwegian |
| nb | Norwegian (Bokmal) |
| nn | Norwegian (Nynorsk) |
| oc | Occitan |
| or | Oriya |
| om | Oromo |
| fa | Persian |
| fa-ir | Persian/Iran |
| pl | Polish |
| pt | Portuguese |
| pt-br | Portuguese (Brazil) |
| pa | Punjabi |
| pa-in | Punjabi (India) |
| pa-pk | Punjabi (Pakistan) |
| qu | Quechua |
| rm | Rhaeto-Romanic |
| ro | Romanian |
| ro-mo | Romanian (Moldavia) |
| ru | Russian |
| ru-mo | Russian (Moldavia) |
| sz | Sami (Lappish) |
| sg | Sango |
| sa | Sanskrit |
| sc | Sardinian |
| gd | Scots Gaelic |
| sd | Sindhi |
| si | Singhalese |
| sr | Serbian |
| sk | Slovak |
| sl | Slovenian |
| so | Somani |
| sb | Sorbian |
| es | Spanish |
| es-ar | Spanish (Argentina) |
| es-bo | Spanish (Bolivia) |
| es-cl | Spanish (Chile) |
| es-co | Spanish (Colombia) |
| es-cr | Spanish (Costa Rica) |
| es-do | Spanish (Dominican Republic) |
| es-ec | Spanish (Ecuador) |
| es-sv | Spanish (El Salvador) |
| es-gt | Spanish (Guatemala) |
| es-hn | Spanish (Honduras) |
| es-mx | Spanish (Mexico) |
| es-ni | Spanish (Nicaragua) |
| es-pa | Spanish (Panama) |
| es-py | Spanish (Paraguay) |
| es-pe | Spanish (Peru) |
| es-pr | Spanish (Puerto Rico) |
| es-es | Spanish (Spain) |
| es-uy | Spanish (Uruguay) |
| es-ve | Spanish (Venezuela) |
| sx | Sutu |
| sw | Swahili |
| sv | Swedish |
| sv-fi | Swedish (Finland) |
| sv-sv | Swedish (Sweden) |
| ta | Tamil |
| tt | Tatar |
| te | Teluga |
| th | Thai |
| tig | Tigre |
| ts | Tsonga |
| tn | Tswana |
| tr | Turkish |
| tk | Turkmen |
| uk | Ukrainian |
| hsb | Upper Sorbian |
| ur | Urdu |
| ve | Venda |
| vi | Vietnamese |
| vo | Volapuk |
| wa | Walloon |
| cy | Welsh |
| xh | Xhosa |
| ji | Yiddish |
| zu | Zulu |