Admidio Language Overrides Plugin — change how Admidio words things
Search all texts of Admidio and replace them with your own wording, without editing XML files.
- Plugin ID
language-overrides- Author
- Reinhold Kainhofer
- License
- GPL 2
- Category
- Administration
- Supported databases
- (MySQL, MariaDB, PostgreSQL)
- Supported languages
- English, Deutsch (du), Deutsch (Sie)
- Tags
- translation language wording
Description
Let an administrator search modify all translated texts of Admidio and replace any of them with their own wording, for example “Mitgliederliste” instead of “Kontakte”, without editing XML files. The plugin is only needed to setup the modified texts. Once the texts are saved, the normal Admidio translation methods use the changed texts without the help of this plugin.
Downloads
No releases have been published yet.
Installation
As administrator, go to Admidio's plugin manager (Admidio 6.0 or later and PHP 8.2 or later required), select “Add plugin” and upload the plugin ZIP file, then enable the plugin. The plugin has no database tables. Its page appears in the menu below Extensions for administrators only. Its texts are available in English and German (informal and formal).
How it works
Admidio reads adm_my_files/languages/<language>.xml before its own language file of that language (and before the language files of the plugins), so an entry in such a file replaces the text. The plugin is the interface to these files:
- Find a text: live search (as you type) by what a text says or by its text id, in one language chosen in a dropdown and, if ticked (the default), in English too. With “Regular expression” ticked the query is a PHP (PCRE) expression, case-insensitive and without delimiters, matched against the texts as written in the files (
^Kont.*e$) and against the text ids; an invalid expression is reported. Core and plugin texts are searched. Texts that only the installer shows (INS_…) are left out unless the setting says otherwise. - Change a text: shows the original and your text for the language, and for English if ticked. A text equal to the original removes the override; a language you did not edit is not written. For German, a checkbox (ticked by default) gives the other form of address,
de(du) orde-DE(Sie), the same text. - Your overrides: all entries of all override files with their original and these states: the original text was changed by an update since the override was written, the text id no longer exists, or the override leaves out a value (
#VAR1#) that the original shows. “Restore the original” removes an override.
Things to know
- An override belongs to one language. A text changed in
enis not seen by users ofde, because the German file has the text already.deandde-DEare separate languages. - Overrides are valid for the whole installation, not for one organization.
- Only text ids that Admidio looks up can be changed. Names that users typed into the database (roles, categories, lists) and the country names are not language texts.
- Entries carry an attribute
originalwith the text of the core at the time. Admidio ignores it. - A text may use the values
#VAR1#,#VAR2#… the original uses. A value that is not in the original is refused. A line break is typed as a new line and stored as\n. - Saving rebuilds the running sessions, which is what makes a new or changed file effective for users who are logged in.
Files and backups
A file is changed under a lock, by editing the document that is there, so comments in it survive, and is replaced with a rename. Before that the old file is copied to the backup folder of the installation (the preference system_backup_path, by default adm_my_files/backups/) into the subfolder language-overrides/, as <language>-YYYYMMDD-HHMMSS-mmm.xml. If the copy cannot be made, nothing is changed.
A form that was opened before somebody else changed the file is refused (“open the text again”).
Settings
Administration → Preferences → Contents → Language overrides
| Setting | Default | Meaning |
|---|---|---|
| Backups per language | 20 | How many copies of each override file are kept in the backup folder; 0 turns the copies off. |
| Search installer texts | off | The texts that only the installation and the update show (INS_…) are left out of the search unless this is switched on. |
Not in this version
- Find-and-replace of a word over many texts, with a preview.
- Export and import of the override files, a command line interface.
- A check of the markup in a text. A text goes into pages as HTML like every text of Admidio does, and only administrators can write it.
Source code
The source code is on GitHub.