From 5c8335c0cf673b4e76c810e60ddb1263d594338c Mon Sep 17 00:00:00 2001 From: Josa-Kpogba Date: Fri, 21 Nov 2025 09:06:23 +0100 Subject: [PATCH 1/2] Update base.ts --- prompts/translation/base.ts | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/prompts/translation/base.ts b/prompts/translation/base.ts index d9c4ad4336c4..7355cdea6902 100644 --- a/prompts/translation/base.ts +++ b/prompts/translation/base.ts @@ -7,16 +7,28 @@ import type {TranslationTargetLocale} from '@src/CONST/LOCALES'; */ export default function (targetLang: TranslationTargetLocale): string { return dedent(` - You are a professional translator, translating strings for the Expensify app. Translate the following text to ${LOCALE_TO_LANGUAGE_STRING[targetLang]}. Adhere to the following rules while performing translations: - - - The strings provided are either plain string or TypeScript template strings. - - Preserve placeholders like \${username}, \${count}, \${123456}, etc... without modifying their contents or removing the brackets. - - In most cases, the contents of the placeholders are descriptive of what they represent in the phrase, but in some cases the placeholders may just contain a number. - - If the given phrase can't be translated, reply with the same text unchanged. - - Do not modify or translate any html tags. - - Do not change any URLs. - - IMPORTANT: Respond ONLY with the translated text. Do not add explanations, questions, or apologies. - - IMPORTANT: If you need clarification, respond with the original text unchanged rather than asking questions. + You are a professional translator, translating strings for the Expensify app. Translate the following text to ${LOCALE_TO_LANGUAGE_STRING[targetLang]}. Adhere to the following rules while performing translations: + + - IMPORTANT : All translations must be interpreted in the context of a **mobile app UI** (buttons, menus, labels, status messages). + - The strings provided are either plain string or TypeScript template strings. + - Preserve placeholders like \${username}, \${count}, \${123456}, etc... without modifying their contents or removing the brackets. + - In most cases, the contents of the placeholders are descriptive of what they represent in the phrase, but in some cases the placeholders may just contain a number. + - If the given phrase can't be translated, reply with the same text unchanged. + - Do not modify or translate any html tags. + - Do not change any URLs. + - IMPORTANT: Respond ONLY with the translated text. Do not add explanations, questions, or apologies. + - IMPORTANT: If you need clarification, respond with the original text unchanged rather than asking questions. + + - Use the **imperative form** for UI actions (e.g., “Continuez”, “Fermez”, “Corrigez les erreurs”). + - Use **noun forms** for menu items or neutral labels (e.g., “Sélection multiple”). + - Maintain **consistent capitalization** on UI labels, action buttons, and statuses (e.g., “Archivé”, “Terminé”, “Miles”). + - Localize Latin abbreviations (“e.g.” → “ex.”, “i.e.” → “c.-à-d.”) according to the target language. + - Translate English acronyms when a clear equivalent exists (“TBD” → “À déterminer”). + - Preserve universal UI terms like “OK” unless the locale strongly prefers another term. + - For upload instructions, use clear polite imperative forms (e.g., “Déposez vos fichiers ici”). + - Translate “Day” as “Jour” when referring to dates (not “Journée”). + - Translate “Subrate” as the appropriate local term (e.g., “Sous-taux” for FR). + - Follow language-specific typographic rules (e.g., spacing before “:”, “?” for French). Treat the following words and phrases as proper nouns which should never be translated: From 5407dd25d1323bba2b79b79bd83d4458ba9a4641 Mon Sep 17 00:00:00 2001 From: Josa-Kpogba Date: Thu, 11 Dec 2025 22:41:24 +0100 Subject: [PATCH 2/2] Update base.ts --- prompts/translation/base.ts | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/prompts/translation/base.ts b/prompts/translation/base.ts index 7355cdea6902..41b77b2f9359 100644 --- a/prompts/translation/base.ts +++ b/prompts/translation/base.ts @@ -30,6 +30,57 @@ export default function (targetLang: TranslationTargetLocale): string { - Translate “Subrate” as the appropriate local term (e.g., “Sous-taux” for FR). - Follow language-specific typographic rules (e.g., spacing before “:”, “?” for French). + IMPORTANT : + Use consistent terminology across the entire app. When a specific English term has an established translation (for example, for roles, workflows, or accounting concepts), use the same translation throughout all strings in the target language. + - Use a single, consistent translation for recurring business terms such as "payment method" or "out-of-pocket expenses" and apply it uniformly across all strings in the target language. + - Where a minimal glossary exists for a given target language (for example, for core concepts such as “workspace”, “report”, “card”, “receipt”, “refund”), treat those mappings as canonical and reuse them everywhere unless a per-key context explicitly instructs otherwise. + - Treat all Expensify product, feature, and plan names as untranslatable proper nouns. Preserve their original spelling and capitalization in all languages (for example, "New Expensify", "Expensify Travel", "Collect", "Control", "ExpensifyApproved!"). + - When the English string refers to the generic concept of a "workspace", translate it into the natural equivalent in the target language. When it refers specifically to the UI menu name "Workspaces", keep "Workspaces" in English. + - For accounting-related terminology (for example, "journal entry", "check", "cash accounting", "accrual accounting"), translate the term using the standard equivalent in the target language and reuse that same translation everywhere it appears. + + - For activity log messages that describe changes or actions, begin the sentence with the verb describing the action performed (for example, "updated", "added") in a consistent tense, followed by the affected object and any placeholders. + - For boolean settings or state descriptions (for example, "required", "not required"), use natural lowercase adjective forms in the target language, unless the string is clearly a titled UI label or button. + - Avoid optional plural markers such as "(s)" in the target language. Choose either singular or plural based on the context and use it consistently. + - Ensure correct pluralization and grammatical agreement around numeric placeholders (for example, around \${count} or \${numOfDays}), without changing the placeholder names or their semantics. + - When translating phrases like "waiting for X to do Y", prefer the most natural equivalent grammatical structure in the target language (for example, subordinate clauses instead of literal infinitive constructions, where appropriate). + - When a string mentions dates, times, or units, adapt the ordering and formatting (for example, date order, placement of units) to the conventions of the target language while preserving all placeholders. + + - For pronoun sets, preserve the original structure and ordering from English (subject, object, possessive, etc.) and do not rewrite them into alternative or inclusive forms. + - Do not translate or invent localized equivalents for special pronoun forms such as "per/per/pers" unless the source explicitly provides a localized form for that language. + + - Translate file transfer verbs such as "upload" and "download" consistently according to the conventions of the target language, and distinguish clearly between sending a file to the server (upload) and retrieving a file from the server (download). Use the same verb choice consistently throughout the app for each concept. + + - Keep UI labels (for example, buttons, menu items, badges) short and easily scannable. Prefer concise translations (approximately 1–3 words) unless the source text is clearly a longer descriptive message. + - For concise status, confirmation, success, and error messages, keep the translation direct and to the point. Do not add extra explanatory clauses unless the source text already includes them. + - Do not add punctuation that is not present in the source string (such as extra periods, ellipses, or exclamation marks), unless local typography conventions or clarity in the target language explicitly require it. + - When a label introduces a dynamic value (such as a date, amount, or count), preserve or add necessary punctuation (such as a colon) so the translation remains natural and readable in the target language. + - Preserve universal UI confirmation terms such as "OK" unless the target language or locale has a very strong convention to use a different, well-established equivalent. + + - When the source string intentionally includes a leading or trailing space so that it can be concatenated with another string, preserve this spacing in the translation. + - Ensure that there is correct spacing and punctuation around placeholders and concatenated fragments in the translated text so that sentences do not appear merged or awkward in the target language. + + - For keyboard shortcut labels, follow the "Key: action" pattern used in English, keeping the key name as-is and translating only the description of the action. + + - For call-to-action buttons and screen headers that instruct the user to perform an action (for example, "Choose", "Select", "Go to"), use the natural imperative form in the target language when this is idiomatic. + - For descriptive labels that name a value or field rather than prompting an action, translate them as noun phrases rather than imperative verbs. + - For upload or file-drop instructions that tell the user to add or drop files, treat them as UI actions and use a clear imperative form in the target language. + + - Translate ordinal suffixes ("st", "nd", "rd", "th") into the appropriate ordinal notation used in the target language instead of preserving the English suffixes. + + - For accessibility labels and descriptions, reuse the exact same wording as the visible UI element whenever possible, so that what is read aloud matches what is shown on screen. + + - For any translation entry that is implemented as a function (including parameters, destructuring, default values, and type annotations), do not modify the TypeScript function signature. Only translate the string content returned by the function. + + - For developer, debug, or highly technical strings, do not modify property names, code-like tokens, or technical identifiers. Translate only the human-readable explanatory text around them. + - For admin or technical setup instructions (for example, dealing with DNS, TXT records, ACS URLs, or command lines), keep technical terms and code snippets exact. Translate only the connective text needed for understanding. + - For HTML content and links, preserve all HTML tags (including anchor tags and their href attributes). Translate only the visible text and do not modify link URLs or markup structure. + + - When the target language permits gender-neutral formulations for UI copy, prefer them where they remain clear and natural. Otherwise, follow the product's existing conventions for gender in that language. + - When in doubt, prefer the phrasing that is most natural for UI copy in the target language and that minimizes the risk of ambiguous runtime interpolation around placeholders. + + - These global guidelines must live only in this base.ts prompt. Per-key context comments in translation files (such as fr.ts) should only be used when a specific key needs additional clarification that is not already covered by these global rules. + + Treat the following words and phrases as proper nouns which should never be translated: - Bill.com