Multilingualism is controlled by the "Translation" entity. The functionality of exporting strings for translations and importing them is available.
Translation import page (/admin/all/languages):
- Download strings for translation - link to export translations;
- Destination language - code of the language for which the import is performed (ru, en, etc.);
- Format with original lines - lines in txt format, each value must be separated by two empty lines;
- Format with translated strings - strings in txt format, each value must be separated by two empty lines.
During the import of translations, files are split and arrays are created with source strings and their translated counterparts - so it is important that the number of strings (translation objects) match. A search will be performed for already existing rows in the database - if found, an update is performed, otherwise an addition.
The following operations are available for exporting strings (/admin/all/languages/export and /admin/all/languages/export/hard):
- Export - export of translations (download files);
- Generate and export - walk through the content and add strings to the database, after which the translations are exported (file download).
A delete all link is available - /admin/all/languages/clear, which will delete all strings and imported translations.
A language bar can be placed on the site to switch languages:
It is enough to add the required languages and add a parameter of the form ?l=* to the link, where * is the language code (ru, en, etc.). In addition, such a parameter can be sent both by the GET method and by the POST method.
It is worth noting that translations can contain HTML code and line breaks (no more than two breaks, otherwise it counts as the next translation object):
- 09.07.22IT / Misc Convert office files DOC, DOCX, DOCM, RTF to DOCX, DOCM, DOC, RTF, PDF, HTML, XML, TXT formats without loss and markup changes
- 07.07.22IT / Safety How to protect PHP, JS, HTML, CSS source code - obfuscation, minification, compression and encryption
- 06.07.22IT / Safety Connection not secure, problem with Lets Encrypt - how to fix expired 09/30/2021 DST Root CA X3, remove it manually and install ISRG Root X1. Example on MS Windows 7
- 08.07.21IT / Misc How to make a free translation for a website without an API, translate documents in Google Translate
- 06.07.21IT / Misc How to make a subscription button on a website, a subscriber base and automatic mailing