Project 5: a multilingual site
Exponential stores content in many languages, including right-to-left scripts. In this project you add a second language to your study site, translate part of your club site from project 2 and make a siteaccess show it. The steps follow Content languages.
Contents
At a glance
| Level | Intermediate |
| Time | About 3 hours |
| Paths | Editor, administrator |
| Prerequisites | project 2; Understanding siteaccesses and settings; a terminal for task 5 |
Goal
A second content language with at least five translated items, a siteaccess that shows that language first with English as the fallback, and a language plan that explains what a visitor sees for an item that is not translated.
Before you start
Read Content languages, sections 1 to 7, and Languages.
Choose a language you can write, or use German (ger-DE) with short invented sentences.
Know these facts from the guide:
- Adding a language translates nothing and changes no siteaccess: no visitor sees anything new yet (section 4).
- What a visitor sees is decided per siteaccess by
SiteLanguageList[], most preferred first (section 5). - An item that is always available is shown in its main language where no listed language exists (section 6).
Tasks
- Add the language. Setup > Languages, Add language, find it (typing
germanorgerworks), press Add language. Expected: a message such as German (ger-DE) was added. If your site already has it, note that instead. - Translate five items. On each item, click the dashed badge of the language (or choose it under New translation), translate based on the English version, and Send for publishing (Languages).
- Look at the badges. Filled badges are translations that exist, dashed ones are missing.
- Decide the always-available items. Folders and images are usually always available, so a German site still finds them. Check the setting in the Translations window of one folder.
- Show the language. Choose the siteaccess that will show it. If your installation already has one for that
language (the default package creates one per additional language you chose at install time,
Site packages for learners), read its
SiteLanguageListwithphp bin/php/console exp:ini where site/RegionalSettings/SiteLanguageList <siteaccess>. Otherwise set it insettings/siteaccess/<siteaccess>/site.ini.append.phpas in the guide's example: an emptySiteLanguageList[]line first, then your language, theneng-US. - Clear the caches for settings and content:
php bin/php/ezcache.php --clear-tag=ini --allow-root-userand--clear-tag=content(Content languages, section 10). - Check as a visitor. On that siteaccess, open a translated item, an untranslated item, and an untranslated but always-available folder. Write down what you see for each.
- Switch the administration language for yourself in the Interface box, and back (Languages). Note what changes and what does not.
Hand in
- A language plan (half a page): which languages, which is the main one, which items are always available, and why.
- The
exp:ini whereoutput forSiteLanguageListof your siteaccess. - Screenshots: the languages page; an item with both badges filled; the three visitor checks of task 7.
- A short report on what surprised you.
Rubric
Score the four common criteria of Grading your own work, and these checks (7):
- A second content language exists.
- At least five items are translated and published.
- The siteaccess lists the new language first and
eng-USsecond, shown withexp:ini where. - Settings were changed in an
.ini.append.phpfile, not insettings/site.ini. - The three visitor checks are documented, with the reason for each result.
- The report distinguishes content languages from the interface language.
- No machine translation was published without the learner reviewing it.
Stretch goals
- Find what is not translated yet (How do I find what is not translated?).
- Add a right-to-left language and look at the administration with it (Contributing translations).
- Make a translator role that may edit only your language, using the Language limitation (Content languages, section 7), and test it in project 9.
Related pages
- Study projects: overview
- Content languages
- Translating as a student
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.