Skip to content

Conversation

@htssp
Copy link

@htssp htssp commented Nov 30, 2025

Fixes #1371

This PR removes out-of-scope or duplicate language variants from the frontend and backend language lists.

Removed:

  • bn
  • nl-be / nl_BE
  • sk
  • pt (generic)
  • several Latin-script variants: gom-latn, oc-lnc, uz-latn, tzm-latn
  • es-mx was not present in these files

Kept:

  • pt-br (correct locale)

Files updated:

  • app/eventyay/helpers/i18n.py
  • app/eventyay/orga/utils/i18n.py
  • app/eventyay/webapp/src/views/admin/config/main.vue

No translation .po files were touched, since these appear auto-generated.
If needed, I can create a follow-up PR to clean translation folders after confirmation.

All changes validated and build/lint checks pass locally.

Summary by Sourcery

Prune unsupported or duplicate language variants from the application’s configured locale lists to align frontend and backend i18n settings.

Enhancements:

  • Update the admin config moment.js locale list to remove out-of-scope or redundant language codes while keeping the supported Portuguese (Brazil) locale.
  • Align backend i18n language lists in helpers and orga utilities by removing locales that are no longer supported or duplicated.

Screenshot

Here is the language selection dropdown after the update:
image
image

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes out-of-scope or duplicate locale variants from both frontend (moment.js locale list) and backend (supported locales lists) to align available languages with the intended i18n scope and keep only supported variants like pt-br.

Flow diagram for locale validation with updated language lists

graph TD
  A[Admin opens admin config page] --> B[Frontend loads momentLocaleSet]
  B --> C[Admin opens language dropdown]
  C --> D[Admin selects locale]
  D --> E{Locale in momentLocaleSet?}
  E -- No --> F[Locale not selectable in UI]
  E -- Yes --> G[Send selected locale to backend]
  G --> H[Backend checks locale in supported_locales_list]
  H --> I{Locale in supported_locales_list?}
  I -- No --> J[Return validation error]
  I -- Yes --> K[Save configuration]

  subgraph Frontend
    B
    C
    D
    E
    F
  end

  subgraph Backend
    H
    I
    J
    K
  end
Loading

File-Level Changes

Change Details Files
Tighten frontend moment.js locale whitelist to remove unsupported or duplicate language variants.
  • Remove Bengali (bn) locale from the static moment locale set.
  • Remove Dutch (Belgium) (nl-be) in favor of the generic nl entry.
  • Remove Slovak (sk) and generic Portuguese (pt) from the allowed locales.
  • Remove unused Latin-script variants such as gom-latn, oc-lnc, tzm-latn, and uz-latn from the list.
  • Ensure pt-br remains as the only Portuguese variant in the admin config UI.
app/eventyay/webapp/src/views/admin/config/main.vue
Align backend helper i18n locale lists with the new supported language set.
  • Remove tzm-latn from the helpers i18n locale list.
  • Remove bn, sk, and generic pt from the helpers i18n locale list, keeping pt-br.
  • Leave other locales intact to maintain existing supported languages.
app/eventyay/helpers/i18n.py
app/eventyay/orga/utils/i18n.py

Assessment against linked issues

Issue Objective Addressed Explanation
#1371 Remove the specified out-of-scope or duplicate languages (Bengali, Dutch (Belgium), German (de_DIVEO), Latin, Portuguese (generic), Slovak, Spanish (Mexico)) from the language configuration used for the language dropdown.
#1371 Ensure the language dropdown and underlying i18n configuration only expose the intended supported languages (no duplicates or unused/out-of-scope variants) while keeping valid languages such as German available.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The same locale list now exists in three places (frontend main.vue, helpers/i18n.py, and orga/utils/i18n.py); consider centralizing this into a single source of truth and importing/consuming it in each layer to avoid future drift.
  • In main.vue, the comment about using a static moment locale list might be updated or expanded to reference the shared i18n source (if you centralize it), so future changes to supported locales are less likely to miss the frontend.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The same locale list now exists in three places (frontend `main.vue`, `helpers/i18n.py`, and `orga/utils/i18n.py`); consider centralizing this into a single source of truth and importing/consuming it in each layer to avoid future drift.
- In `main.vue`, the comment about using a static moment locale list might be updated or expanded to reference the shared i18n source (if you centralize it), so future changes to supported locales are less likely to miss the frontend.

## Individual Comments

### Comment 1
<location> `app/eventyay/webapp/src/views/admin/config/main.vue:55-56` </location>
<code_context>
-	'mn', 'mr', 'ms', 'ms-my', 'mt', 'my', 'nb', 'ne', 'nl', 'nl-be', 'nn', 'oc-lnc', 'pa-in', 'pl', 'pt', 'pt-br',
-	'ro', 'ru', 'sd', 'se', 'si', 'sk', 'sl', 'sq', 'sr', 'sr-cyrl', 'ss', 'sv', 'sw', 'ta', 'te', 'tet',
-	'tg', 'th', 'tk', 'tl-ph', 'tlh', 'tr', 'tzl', 'tzm', 'tzm-latn', 'ug-cn', 'uk', 'ur', 'uz', 'uz-latn', 'vi',
+	'mn', 'mr', 'ms', 'ms-my', 'mt', 'my', 'nb', 'ne', 'nl', 'nn', 'pa-in', 'pl', 'pt-br',
+	'ro', 'ru', 'sd', 'se', 'si', 'sl', 'sq', 'sr', 'sr-cyrl', 'ss', 'sv', 'sw', 'ta', 'te', 'tet',
+	'tg', 'th', 'tk', 'tl-ph', 'tlh', 'tr', 'tzl', 'tzm', 'ug-cn', 'uk', 'ur', 'uz', 'vi',
 	'x-pseudo', 'yo', 'zh-cn', 'zh-hk', 'zh-mo', 'zh-tw',
</code_context>

<issue_to_address>
**issue (bug_risk):** Consider whether dropping locales like `pt` and `sk` is expected in the UI and if any stored config values rely on them.

Since `pt`, `sk`, and other locales are being removed from `momentLocaleSet`, any existing config or persisted settings using those codes may no longer resolve correctly and could fall back to defaults. Please verify whether these locales are used in stored data and, if so, ensure a migration or mapping strategy (e.g., `pt``pt-br`) so settings don’t end up in an invalid state.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +55 to +56
'mn', 'mr', 'ms', 'ms-my', 'mt', 'my', 'nb', 'ne', 'nl', 'nn', 'pa-in', 'pl', 'pt-br',
'ro', 'ru', 'sd', 'se', 'si', 'sl', 'sq', 'sr', 'sr-cyrl', 'ss', 'sv', 'sw', 'ta', 'te', 'tet',
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Consider whether dropping locales like pt and sk is expected in the UI and if any stored config values rely on them.

Since pt, sk, and other locales are being removed from momentLocaleSet, any existing config or persisted settings using those codes may no longer resolve correctly and could fall back to defaults. Please verify whether these locales are used in stored data and, if so, ensure a migration or mapping strategy (e.g., ptpt-br) so settings don’t end up in an invalid state.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes out-of-scope and duplicate language variants from i18n configuration files to align with supported locales. The changes clean up language codes that are redundant or outside the project's scope while preserving the correctly specified locale for Portuguese (Brazil).

Key changes:

  • Removed 7 language codes from frontend moment.js locale configuration
  • Removed 5 language codes from backend Python i18n helpers
  • Maintained consistency across all three configuration files

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/eventyay/webapp/src/views/admin/config/main.vue Updated frontend moment.js locale list by removing 'bn', 'nl-be', 'sk', 'pt', 'gom-latn', 'oc-lnc', 'tzm-latn', and 'uz-latn'
app/eventyay/orga/utils/i18n.py Removed 'bn', 'sk', 'pt', and 'tzm-latn' from backend moment_locales set
app/eventyay/helpers/i18n.py Removed 'bn', 'sk', 'pt', and 'tzm-latn' from backend moment_locales set

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sak1012
Copy link
Member

Sak1012 commented Dec 1, 2025

Thanks. Could you please add a screenshot of the language selection option and remove the translation files?

@htssp
Copy link
Author

htssp commented Dec 4, 2025

Hi @Sak1012 @mariobehling
I have added a screenshot of the language selection dropdown as requested.
Also, I reviewed the branch and can confirm that no translation (.po/.pot/.json) files were added or modified, the PR only involves configuration updates.
Please let me know if you need anything else.
Thanks!

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please change as follows:

  • Please remove information like "inofficial translation" or "translation in progress"
  • Brazilian Portuguese should be Portoguese (Brazil)
  • Finnish and Polish should be sorted alphabetically into the list
  • Malay should be there only once
  • German should be in the alphabetical list
  • However "English" should stay on top as the default

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Clean up language list: remove duplicates/out-of-scope languages and ensure remaining languages are available

4 participants