Skip to content

i18n: retranslate Attributes.definition_successful_adding / definition_successful_updating for remaining languages #4660

Closed

Description

@objecttothis

Background

The English source strings for two keys in app/Language/en/Attributes.php were corrected in 9d59f8c:

Key Old New
definition_successful_adding You have successfully added item You have successfully added the attribute.
definition_successful_updating You have successfully updated attribute You have successfully updated the attribute

en-GB, ru, and az have already been aligned. The following language files still carry translations based on the old (incorrect) English and need their definition_successful_adding / definition_successful_updating values retranslated to match the corrected meaning (successfully added/updated the attribute, not "item"):

  • ar-EG
  • ar-LB
  • bg
  • bs
  • ckb
  • cs
  • da
  • de-CH
  • de-DE
  • el
  • es-ES
  • es-MX
  • fa
  • fr
  • he
  • hr-HR
  • hu
  • hy
  • id
  • it
  • km
  • lo
  • ml
  • nb
  • nl-BE
  • nl-NL
  • pl
  • pt-BR
  • ro
  • sv
  • sw-KE
  • sw-TZ
  • ta
  • th
  • tl
  • tr
  • uk
  • ur
  • vi
  • zh-Hans
  • zh-Hant

Task

For each file above, update definition_successful_adding and definition_successful_updating in app/Language/<locale>/Attributes.php to correctly reference "attribute" rather than "item"/"product", preserving each language's existing grammar/tone.

Activity

  1. objecttothis commented on Oct 22, 2026

    @objecttothis
    MemberAuthor

    Claude Issue Checker Agent (cc @objecttothis)

    Investigated against current master.

    Status: Still present (translations not updated) — spot-checked several locales.

    • app/Language/fr/Attributes.php: 'definition_successful_adding' => 'Vous avez ajouté l\'article avec succès' — still says "the item" (l'article), not "the attribute" (l'attribut).
    • app/Language/de-DE/Attributes.php: 'definition_successful_adding' => 'Artikel erfolgreich hinzugefügt' — still says "Item added successfully" rather than referencing the attribute.

    Both are on the list of locales in this issue that still need retranslation, and neither has been updated. I did not check all ~39 listed locale files individually, but the two I sampled (fr, de-DE) confirm the issue is still open; I found no related merged PR correcting these keys across locales.

  2. added a commit that references this issue on Nov 4, 2026
    9a304c0
  3. BudsieBuds commented on Nov 4, 2026

    @BudsieBuds
    Member

    @coderabbitai Was this issue resolved and closed rightfully by the linked PR/commits? Please verify all requirements were met and flag any missing parts or regressions.

  4. coderabbitai commented on Nov 4, 2026

    @coderabbitai
    Contributor
    Analysis chain

    Script executed:

    #!/bin/bash
    set -euo pipefail
    gh api repos/opensourcepos/opensourcepos/issues/4660
    gh api --paginate repos/opensourcepos/opensourcepos/issues/4660/comments
    gh api --paginate repos/opensourcepos/opensourcepos/issues/4660/timeline

    Length of output: 46230


    Script executed:

    #!/bin/bash
    set -euo pipefail
    git rev-parse HEAD
    git status --short
    fd -H '^(AGENTS\.md|Attributes\.php)$' . -E .git
    ast-grep outline app/Language/fr/Attributes.php
    ast-grep outline app/Language/de-DE/Attributes.php

    Length of output: 2140


    Script executed:

    #!/bin/bash
    set -euo pipefail
    cat -n AGENTS.md
    gh api repos/opensourcepos/opensourcepos/pulls/4793 --jq '{number,title,merged,merged_at,merge_commit_sha,base:.base.sha,head:.head.sha,body}'
    gh api --paginate repos/opensourcepos/opensourcepos/pulls/4793/commits --jq '.[] | {sha,message:.commit.message}'
    git show --no-patch --format=fuller HEAD
    rg -n -C2 "'definition_successful_(adding|updating)'\s*=>" app/Language
    fd -H '(MY_Language|LanguageFilesTest|LanguageTest|App\.php|locale_helper\.php|composer\.json|composer\.lock)$' . -E .git
    rg -n -C3 'function getLine\s*\(|class MY_Language\b|Attributes\.definition_successful_(adding|updating)' .

    Length of output: 56345


    Script executed:

    #!/bin/bash
    set -euo pipefail
    ast-grep outline app/Libraries/MY_Language.php
    fd -i '.*language.*test.*\.php$' .
    fd -i '^Services\.php$' .
    ast-grep outline app/Controllers/Attributes.php --match 'Save|save'
    rg -n -C3 'MY_Language|function language\s*\(' app
    python - <<'PY'
    import pathlib,re,subprocess,collections
    locales="ar-EG ar-LB bg bs ckb cs da de-CH de-DE el es-ES es-MX fa fr he hr-HR hu hy id it km lo ml nb nl-BE nl-NL pl pt-BR ro sv sw-KE sw-TZ ta th tl tr uk ur vi zh-Hans zh-Hant".split()
    keys=['definition_successful_adding','definition_successful_updating']
    counts=collections.Counter()
    for loc in locales:
        path=f'app/Language/{loc}/Attributes.php'
        old=subprocess.check_output(['git','show',f'HEAD^:{path}'],text=True)
        newpath=path.replace('/hr-HR/','/hr/')
        new=pathlib.Path(newpath).read_text()
        print(loc, '=> hr' if loc=='hr-HR' else '')
        for key in keys:
            pat=r"""^\s*'"""+key+r"""'\s*=>\s*('(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*")"""
            a=re.search(pat,old,re.M).group(1)
            b=re.search(pat,new,re.M).group(1)
            counts[(key,'empty' if b=="''" else 'localized')]+=1
            counts[(key,'changed' if a!=b else 'unchanged')]+=1
            print(' ',key, a,'->',b if a!=b else '(unchanged)')
    print('COUNTS',dict(counts))
    PY
    git diff HEAD^ HEAD -- app/Libraries/MY_Language.php app/Controllers/Attributes.php
    git diff HEAD^ HEAD -- app/Language/nl-BE/Attributes.php app/Language/uk/Attributes.php app/Language/bs/Attributes.php

    Length of output: 14470


    Script executed:

    #!/bin/bash
    set -euo pipefail
    ast-grep outline app/Config/Services.php --match language
    ast-grep outline tests/LanguageFilesTest.php
    cat -n app/Libraries/MY_Language.php
    sed -n '35,65p' app/Config/Services.php | cat -n
    ast-grep outline app/Controllers/Attributes.php
    sed -n '125,185p' app/Controllers/Attributes.php
    cat -n tests/LanguageFilesTest.php
    rg -n -C2 "'hr'|'hr-HR'|'definition_successful_(adding|updating)'" app/Config/App.php app/Helpers/locale_helper.php app/Language/nl-BE/Attributes.php app/Language/uk/Attributes.php app/Language/bs/Attributes.php
    git diff HEAD^ HEAD -- app/Language/en/Attributes.php app/Config/Services.php
    gh api repos/opensourcepos/opensourcepos/commits/master --jq '{sha: .sha, message: .commit.message}'

    Length of output: 15845


    @BudsieBuds #4793 fixed the wrong-entity messages, but it did not complete every requirement in #4660. Closure is justified as a fallback-based fix, not as completed retranslation.

    I checked current master at 9a304c0, which merged #4793 on November 4. I compared both requested keys across all 41 listed locales, including hr-HR, now renamed to hr.

    What the PR fixed

    • The French and German “item added” translations cited in the earlier comment are gone. Both now use ''.
    • The other outdated adding messages also use empty fallbacks or retain translations that reference attributes.
    • The Malayalam and Tagalog update messages no longer refer to “Item Kit.” The Lao update message no longer refers to an item.
    • German updating text now includes the missing space in Attribut erfolgreich.
    • Both keys remain present in every requested catalog.

    The empty values are functional, not blank UI messages. MY_Language::getLine() loads English when the localized value is empty. Both English messages correctly reference “the attribute.” The controller then appends the attribute name.

    Missing requirements

    1. Native-language retranslation remains incomplete.

    Key Empty English fallback Retained localized value
    definition_successful_adding 36 5
    definition_successful_updating 12 29

    These 48 empty entries include entries that were already empty before the PR. They are not all newly removed translations.

    The fallback approach matches the PR’s stated scope and current repository guidance. However, it does not satisfy the issue’s literal request to retranslate both messages while preserving each language’s grammar and tone.

    2. Two retained update messages still do not explicitly reference an attribute.

    Neither contains the wrong entity, but neither meets the explicit attribute-wording requirement. Both predate this PR.

    Regression and test assessment

    I found no new functional regression in these two message paths by static inspection. Replacing incorrect localized text with English is an intentional localization trade-off.

    The added LanguageFilesTest.php checks catalog structure, syntax, key parity, ordering, duplicates, and locale registration. It does not verify translation meaning or runtime fallback behavior. I did not execute repository code or tests.

    Recommendation: Keep #4660 closed only if English fallback is the accepted completion criterion. If the original retranslation requirement still applies, reopen it or track the remaining translations and the two generic update messages in a follow-up issue.

    You are interacting with an AI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions