Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/locales/ca/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions public/locales/ca@valencia/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
41 changes: 22 additions & 19 deletions public/locales/he/common.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"account": {
"change_language": "",
"change_language": "שנה שפה",
"change_language_details": {
"messages": {
"language_changed": ""
"language_changed": "השפה שונתה בהצלחה"
},
"placeholder": "",
"title": ""
"placeholder": "בחר שפה",
"title": "בחר שפה"
},
"debug_info": "",
"debug_info_details": {
Expand All @@ -16,25 +16,28 @@
"new_version_available": "",
"title": "",
"user_agent": "",
"version": ""
"version": "גרסה"
},
"download_app": "",
"default_balance_currency": "מטבע ברירת מחדל ליתרה",
"download_app": "הורד יישומון",
"download_app_details": {
"download_as_pwa": "",
"title": "",
"download_as_pwa": "ניתן להוריד את ספליט-פרו בתור PWA למסך הבית שלך.",
"title": "הורד יישומון",
"using_android": "",
"using_ios": "",
"video": ""
},
"download_splitpro_data": "",
Comment on lines 26 to 30

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 5 'returnEmptyString|fallbackLng|fallbackLocale|i18next|next-intl|public/locales|common\.json' .

Repository: oss-apps/split-pro

Length of output: 43526


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- next-i18next.config.js ---'
cat -n next-i18next.config.js

printf '%s\n' '--- i18n helpers ---'
cat -n src/utils/i18n/server.ts
cat -n src/utils/i18n/client.ts

printf '%s\n' '--- locale files and target keys ---'
git ls-files 'public/locales/*/common.json' | sort
python3 - <<'PY'
import json
from pathlib import Path

keys = [
    ("download_splitpro_data",),
    ("download_splitpro_data", "using_android"),
    ("download_splitpro_data", "using_ios"),
    ("download_splitpro_data", "video"),
]
for path in sorted(Path("public/locales").glob("*/common.json")):
    try:
        data = json.loads(path.read_text())
    except Exception as exc:
        print(path, "INVALID_JSON", exc)
        continue
    node = data
    values = []
    for keypath in keys:
        node = data
        for key in keypath:
            node = node.get(key) if isinstance(node, dict) else None
        values.append(( ".".join(keypath), node, type(node).__name__))
    print(path, values)
PY

printf '%s\n' '--- translation configuration options ---'
rg -n -C 8 'i18n\.init|initReactI18next|returnEmptyString|fallbackNS|fallbackLng|defaultNS|ns:' src next-i18next.config.js next.config.js package.json

Repository: oss-apps/split-pro

Length of output: 50374


🌐 Web query:

i18next returnEmptyString default fallback behavior official documentation

💡 Result:

In i18next, the returnEmptyString configuration option controls whether an empty string is treated as a valid translation result [1][2]. The default value for returnEmptyString is true [1][3][2]. When set to true (default), i18next accepts an empty string ("") as a valid translation, and it will be returned as the translation value [1][2]. If you want to prevent empty strings from being returned and instead trigger a fallback (for example, to a fallback language or the key itself), you should set returnEmptyString to false [4][5][6]. When this option is false, i18next treats an empty string as if the key were missing, causing the translation process to continue searching through fallback options [4][5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Hebrew target region ---'
sed -n '1,85p' public/locales/he/common.json

printf '%s\n' '--- English matching region ---'
sed -n '1,85p' public/locales/en/common.json

printf '%s\n' '--- all references to the namespace/key ---'
rg -n -C 4 'download_splitpro_data|using_android|using_ios' src public/locales

printf '%s\n' '--- locale enablement and translation wrappers ---'
rg -n -C 4 "['\"]he['\"]|supportedLanguages|getSupportedLanguages|customServerSideTranslations|serverSideTranslations|useTranslation" src next-i18next.config.js next.config.js --glob '!**/*.map'

Repository: oss-apps/split-pro

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
from pathlib import Path

def lookup(obj, path):
    for part in path.split("."):
        if not isinstance(obj, dict) or part not in obj:
            return "<missing>"
        obj = obj[part]
    return obj

paths = [
    "download_splitpro_data.using_android",
    "download_splitpro_data.using_ios",
    "download_splitpro_data.video",
    "download_splitpro_data",
]
for locale in ("he", "en", "default"):
    path = Path("public/locales") / locale / "common.json"
    if not path.exists():
        print(locale, "<file missing>")
        continue
    data = json.loads(path.read_text())
    print(locale, {key: lookup(data, key) for key in paths})
PY

Repository: oss-apps/split-pro

Length of output: 559


🌐 Web query:

next-i18next default configuration returnEmptyString i18next options

💡 Result:

The returnEmptyString option is an i18next configuration setting that controls whether an empty string is treated as a valid translation result [1][2]. By default, it is set to true [1][2]. When set to false, i18next treats empty strings as missing translations, which triggers fallback mechanisms (such as falling back to a different language or returning the translation key) [3]. Because next-i18next is built on top of i18next, you can pass this option through to the underlying i18next instance. In your next-i18next configuration file (e.g., next-i18next.config.js), you should include it within the i18nextOptions object rather than at the root level of the configuration [4][5]. Placing it at the root level may cause warnings in some environments because next-i18next expects specific configuration keys [6]. Example usage: // next-i18next.config.js module.exports = { i18n: { defaultLocale: 'en', locales: ['en', 'de'], }, i18nextOptions: { returnEmptyString: false, // Set to false to treat empty strings as invalid }, //... other next-i18next specific options }; You can find comprehensive details on this and other i18next-specific settings in the official i18next configuration documentation [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
from pathlib import Path

targets = {
    "account.download_app_details.using_android",
    "account.download_app_details.using_ios",
    "account.download_app_details.video",
    "account.download_splitpro_data",
}

def lookup(data, dotted):
    value = data
    for part in dotted.split("."):
        if not isinstance(value, dict) or part not in value:
            return ("missing", None)
        value = value[part]
    return ("present", value)

he = json.loads(Path("public/locales/he/common.json").read_text())
en = json.loads(Path("public/locales/en/common.json").read_text())
config = Path("next-i18next.config.js").read_text()

print("next-i18next config overrides returnEmptyString=false:",
      "returnEmptyString: false" in config or "returnEmptyString:false" in config)
print("Hebrew declared in next-i18next.config.js:", "'he'" in config or '"he"' in config)

for key in sorted(targets):
    h_state, h_value = lookup(he, key)
    e_state, e_value = lookup(en, key)
    print(f"{key}: he={h_state}:{h_value!r}; en={e_state}:{e_value!r}")
    if h_state == "present" and h_value == "":
        print(f"  i18next default outcome: empty string is retained unless returnEmptyString=false")
PY

if node -e "require.resolve('i18next')" >/dev/null 2>&1; then
  node - <<'JS'
  const i18next = require('i18next');
  const instance = i18next.createInstance();
  instance.init({
    lng: 'he',
    fallbackLng: 'en',
    resources: {
      he: { common: { sample: '' } },
      en: { common: { sample: 'English fallback' } },
    },
    ns: ['common'],
    defaultNS: 'common',
  }).then(() => {
    console.log('runtime default:', JSON.stringify(instance.t('sample')));
    return instance.init({ returnEmptyString: false });
  }).then(() => {
    console.log('runtime returnEmptyString=false:', JSON.stringify(instance.t('sample')));
  });
  JS
else
  echo "i18next runtime unavailable; no dependency execution performed"
fi

Repository: oss-apps/split-pro

Length of output: 1107


Omit the empty Hebrew translations. When Hebrew is enabled, next-i18next retains "" by default and renders blank labels instead of fallback text. Hebrew is not currently listed in next-i18next.config.js.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@public/locales/he/common.json` around lines 26 - 30, Remove the empty Hebrew
translation entries under the visible translation section, including
using_android, using_ios, video, and download_splitpro_data, so next-i18next can
use fallback text instead of retaining blank labels.

"edit_name": {
"placeholder": "",
"title": ""
"avatar_label": "תמונת פרופיל",
"placeholder": "הכנס שם",
"select_avatar": "בחר תמונה",
"title": "ערוך פרטים"
},
"follow_on_x": "",
"import_from_splitwise": "",
"follow_on_x": "עקבו אחרינו ב-X",
"import_from_splitwise": "יבוא מ-Splitwise",
"import_from_splitwise_details": {
"choose_file": "",
"choose_file": "בחר קובץ",
"export_splitwise_data_button": "",
"follow_to_export_splitwise_data": "",
"messages": {
Expand All @@ -43,26 +46,26 @@
"no_file_chosen": "",
"note": ""
},
"logout": "",
"logout": "התנתקות",
"messages": {
"submit_error": "",
"submit_success": ""
"submit_success": "פרטים עודכנו"
},
"notifications": {
"disable_notification": "",
"enable_notification": "",
"disable_notification": "בטל התראה",
"enable_notification": "אפשר התראה",
"messages": {
"notification_granted": ""
}
},
"star_on_github": "",
"star_on_github": "שימו לנו כוכב ב-GitHub",
"submit_feedback": "",
"submit_feedback_details": {
"placeholder": "",
"title": ""
},
"support_us": "",
"title": "",
"title": "חשבון",
"write_review": ""
},
"actions": {
Expand Down
Loading
Loading