Hi,
as I, like many others, like the product but would need a different language, I searched for an solution. I have not seen one to day so I would like to showcase mine.
I found that for php based projects a gettext variant with various locales can be used. I foked the project and tested a bunch and my primitive tests, guided by claude code, seem to work finde. Maybe you can use the concept and refine ist and in the future implement your version. I will try to help wherever I can but I do not feel comfortable doing a complete implementation and opening a pull request, as this is not a little fix but something way deeper that you need to control. I can translate for german if needed at any point.
My fork is at my github in the develop branch and everything needed to understand the implementation should be located inside the new locale folder.
General concept aims at shipping itflow.po fiiles for every supported language that i compiled with the provided compile_translations.php into itflow.mo files that locale uses for specific languages.
This header:
msgid ""
msgstr ""
"Project-Id-Version: ITFlow\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-14 12:00+0000\n"
"PO-Revision-Date: 2025-01-14 12:00+0000\n"
"Last-Translator: \n"
"Language-Team: German\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
has all the needed information for locale to understand where to use.
I added fuctions in the functions.php to interpret different php tags for translation. For this to work every single normal paragraph, header and so on would be needed to be replaced by the corresponding "cast" (i am not a dev. sorry dont know how other to call it) around it. Mainly there are 3 casts:
__() for Strings like in Placeholders
$title = __('Dashboard')
<input type="text" placeholder="<?php echo __('Enter your name'); ?>">
echo strtoupper(__('Welcome'));
$message = __('Hello') . ' ' . $name;
sendEmail(__('Welcome Email Subject'), $body);
_e() for normal Strings in html tags
<h1><?php _e('Settings'); ?></h1>
<label><?php _e('Username'); ?></label>
<button><?php _e('Save'); ?></button>
<p><?php _e('Welcome to our application'); ?></p>
_t() for placeholders with dynamic content
echo _t('Welcome back, %s!', $username);
// Output: "Weclome back, John!"
echo _t('Invoice #%s for %s', $invoice_number, $client_name);
// Output: "Invoice #2024-001 für ACME Corp"
So:
__()
= "underscore underscore" = get string
_e()
= "underscore e" = echo string
_t()
= "underscore t" = template string
The settings_localization.php has been modified to control the used language locale via the selected language. In my tests i focused on the administration navbar, the localization settings, the users tab and a few other settings menus.
Database has not been touched by this method.
Edit:
For my setup in debian I needed to manually uncomment the languages inside the /etc/locale.gen,
otherwise locale-gen
would not properly configure the language locales.