Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix: improve date formatting with IntlDateFormatter fallback (b2c565f) (#1048)

Miguel Ribeiro8d43623da9c2
diff --git a/includes/i18n/getlang.php b/includes/i18n/getlang.php
index a80f93e..c26f8b1 100644
--- a/includes/i18n/getlang.php
+++ b/includes/i18n/getlang.php
@@ -4,6 +4,10 @@ $lang = "en";
if (isset($_COOKIE['language'])) {
$selectedLanguage = $_COOKIE['language'];
+ if (array_key_exists($selectedLanguage, $langname_corrections)) {
+ $selectedLanguage = $langname_corrections[$selectedLanguage];
+ }
+
if (array_key_exists($selectedLanguage, $languages)) {
$lang = $selectedLanguage;
}
diff --git a/includes/i18n/jp.php b/includes/i18n/ja.php
similarity index 100%
rename from includes/i18n/jp.php
rename to includes/i18n/ja.php
diff --git a/includes/i18n/languages.php b/includes/i18n/languages.php
index 38ea198..1135e29 100644
--- a/includes/i18n/languages.php
+++ b/includes/i18n/languages.php
@@ -13,7 +13,7 @@ $languages = [
"fr" => ["name" => "Français", "dir" => "ltr"],
"id" => ["name" => "bahasa indonesia", "dir" => "ltr"],
"it" => ["name" => "Italiano", "dir" => "ltr"],
- "jp" => ["name" => "日本語", "dir" => "ltr"],
+ "ja" => ["name" => "日本語", "dir" => "ltr"],
"ko" => ["name" => "한국어", "dir" => "ltr"],
"nl" => ["name" => "Nederlands", "dir" => "ltr"],
"pl" => ["name" => "Polski", "dir" => "ltr"],
@@ -29,4 +29,8 @@ $languages = [
"vi" => ["name" => "Tiếng Việt", "dir" => "ltr"],
"zh_cn" => ["name" => "简体中文", "dir" => "ltr"],
"zh_tw" => ["name" => "繁體中文", "dir" => "ltr"],
+];
+
+$langname_corrections = [
+ "jp" => "ja",
];
\ No newline at end of file
diff --git a/includes/version.php b/includes/version.php
index aafe20b..20aea75 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v4.8.3";
+$version = "v4.8.4";
?>
diff --git a/migrations/000045.php b/migrations/000045.php
new file mode 100644
index 0000000..dcfa05c
--- /dev/null
+++ b/migrations/000045.php
@@ -0,0 +1,4 @@
+<?php
+// This migration corrects the Japanese language code from 'jp' to 'ja' in the user table.
+
+$db->exec("UPDATE user SET language = 'ja' WHERE language = 'jp'");
\ No newline at end of file
diff --git a/scripts/i18n/jp.js b/scripts/i18n/ja.js
similarity index 100%
rename from scripts/i18n/jp.js
rename to scripts/i18n/ja.js