Skip to content

Fix MediaBrowser i18n review findings (follow-up to #529) - #532

Merged
ddon merged 3 commits into
BeamLabEU:devfrom
timujinne:fix/media-browser-i18n-followup
May 11, 2026
Merged

Fix MediaBrowser i18n review findings (follow-up to #529)#532
ddon merged 3 commits into
BeamLabEU:devfrom
timujinne:fix/media-browser-i18n-followup

Conversation

@timujinne

Copy link
Copy Markdown
Contributor

Follow-up to PR #529, addressing review findings on the cherry-picked MediaBrowser i18n commit.

Major fixes

1. List-view dropdown was not wrapped

The folder context-menu items are duplicated between grid view and list view. Grid view (media_browser.html.heex:735, 766, 769) was wrapped in the original commit; list view at :1047, 1078, 1081 was missed. Now both views show the same translations.

2. Composed ngettext for messages with two independent counts

Three messages embedded two counts in a single gettext call (%{new} file(s) uploaded, %{err} failed), which forced the translator to write awkward файл(ов) constructions and made correct Russian/Estonian pluralization impossible.

Each is now composed:

uploaded=ngettext("%{count} file uploaded","%{count} files uploaded",new_count)failed=ngettext("%{count} failed","%{count} failed",error_count)gettext("Partially successful: %{uploaded}, %{failed} due to missing storage buckets.",uploaded: uploaded,failed: failed)

Applied to media_browser.ex:1743 (build_partial_success_message), :1770 (build_new_and_duplicates_message), and :1879 (delete_selected_confirm, files+folders branch).

Minor fixes

  • %{count} selected (ru): "%{count} выбран" implied masculine gender, which was wrong when selecting folders (feminine). Switched to the gender-neutral predicative "Выбрано: %{count}" for all 3 plural forms. Estonian gets the analogous "Valitud: %{count}".
  • String.upcase(f.file_type || "FILE") — fallback "FILE" now goes through gettext so the viewer's type badge is localized for unknown file types.

Translation coverage

  • Updated priv/gettext/default.pot via mix gettext.extract.
  • All locale .po files re-merged.
  • Russian (3-form plurals) and Estonian (2-form plurals) filled for all new ngettext/gettext entries; previous fuzzy markers cleared.
  • Other locales (de/es/fr/it/pl) fall back to the English msgid until translated.

Ubuntu Timdev Manager added 3 commits May 11, 2026 11:32
All user-facing strings in the media browser (buttons, titles, tooltips,
placeholders, empty states, flash notifications, and confirm dialogs) are
now routed through gettext/ngettext. Russian and Estonian translations
filled in (3-form and 2-form plurals respectively).
List-view dropdown duplicates of the folder menu (Color heading, delete
data-confirm, Delete button) were missed in the original sweep — wrap
them so list view matches grid view.
Three flash/confirm messages embedded two independent counts in a single
gettext call, which made correct pluralization impossible in Russian
(3 forms) and Estonian (2 forms). Each is now composed from two ngettext
calls injected into the surrounding gettext template:
- build_partial_success_message: uploaded/failed counts
- build_new_and_duplicates_message: added/duplicate counts
- delete_selected_confirm (files+folders branch): files/folders counts
Russian translation for "%{count} selected" used the masculine predicate
"%{count} выбран", which is wrong for folders (feminine). Switched to
the gender-neutral "Выбрано: %{count}" across all plural forms.
Wrap the "FILE" fallback for unknown file_type so the viewer label is
localized along with the rest of the metadata pane.
…8n-followup
# Conflicts:
#	lib/phoenix_kit_web/components/media_browser.ex
#	priv/gettext/de/LC_MESSAGES/default.po
#	priv/gettext/default.pot
#	priv/gettext/en/LC_MESSAGES/default.po
#	priv/gettext/es/LC_MESSAGES/default.po
#	priv/gettext/et/LC_MESSAGES/default.po
#	priv/gettext/fr/LC_MESSAGES/default.po
#	priv/gettext/it/LC_MESSAGES/default.po
#	priv/gettext/pl/LC_MESSAGES/default.po
#	priv/gettext/ru/LC_MESSAGES/default.po
@ddon
ddon merged commit a184f03 into BeamLabEU:devMay 11, 2026
timujinne added a commit to timujinne/phoenix_kit that referenced this pull request May 11, 2026
timujinne added a commit to timujinne/phoenix_kit that referenced this pull request May 11, 2026
Brings main up to date with dev (102 commits) including:
- PR BeamLabEU#529 sidebar i18n (merged via upstream)
- PR BeamLabEU#532 MediaBrowser i18n followup (merged via upstream)
- fix/orphan-query-publishing-versions
@timujinne
timujinne deleted the fix/media-browser-i18n-followup branch May 18, 2026 12:03
Sign up for freeto 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

@timujinne@ddon