Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website translation with php array files #48

Merged
merged 12 commits into from
Aug 16, 2024

Conversation

lucaritossa
Copy link
Contributor

@lucaritossa lucaritossa commented Nov 29, 2023

The website has been revised moving all relevant english text into specific file /languages/en.php.
Italian translation has been prepared into /languages/it.php file.

These files contain the $lang["key"] array with all text translated.

The usage is simple, for example the _btn_back.php changed from

<a href="landing.php" class="btn btn-lg btn-primary btn-block">Return to menu</a>

to

<a href="landing.php" class="btn btn-lg btn-primary btn-block"><?php echo $lang["return_to_menu"] ?></a>

/languages/en.php contains

$lang["return_to_menu"] = "Return to menu";

/languages/it.php contains

$lang["return_to_menu"] = "Ritorna al menu";

New "Language" setting is available in Settings page, currently with "en" and "it" values.

image

After saved the settings you will see automatically the website translated to the selected language.

There is only 1 known limit on this solution: the english text defined into javascript files can't be easly translated because ot the client-side nature.

To translate other languages follow these steps:

  1. Copy the en.php file and paste it with the name of the language you want to translate (ie: fr.php, de.php)
  2. Edit the copied file and translate all text into the target language.
  3. Edit the functions_design.php and add the new language into $AvailableLanguages array

I waited 1 month of personal testing before to create this PR and haven't found any issues.

This solve issue #25
I didn't change the $app_version in configuration_system.php. I propose 2.0.0 or at least 1.3.0.

@lucaritossa lucaritossa changed the title Website translation with php array files #25 Website translation with php array files Nov 29, 2023
@lucaritossa lucaritossa changed the title #25 Website translation with php array files Website translation with php array files Nov 29, 2023
@guanlisheng guanlisheng merged commit 0d73f20 into moneymanagerex:master Aug 16, 2024
@lucaritossa lucaritossa deleted the feature/localization branch November 30, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants