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

marvel at flowers and others added 30 commits October 10, 2025 07:32
Currently translated at 0.1% (3 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/zh_Hant/
Currently translated at 0.2% (9 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/zh_Hant/
Currently translated at 0.4% (18 of 4121 strings)

Translation: eventyay/Eventyay Tickets
Translate-URL: https://hosted.weblate.org/projects/open-event/eventyay-tickets/pl_INFORMAL/
Currently translated at 2.9% (123 of 4121 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
Currently translated at 2.9% (123 of 4121 strings)

Translation: eventyay/eventyay
Translate-URL: https://hosted.weblate.org/projects/eventyay/eventyay/zh_Hant/
The issue was caused by unconditional access to test_form.cleaned_data
without checking if the form validation succeeded. When test_form.is_valid()
returned False, accessing cleaned_data could raise AttributeError or return
incomplete data, causing a 500 error.

Solution: Added conditional check to only access cleaned_data when form is
valid, otherwise use empty dict for initial values. This ensures the export
page loads properly even when no valid GET parameters are provided.

Changes:
- Modified ExportMixin.exporters property in control/views/orders.py
- Added validation check before accessing test_form.cleaned_data
- Fallback to empty dict when form is invalid
Applied the same fix from issueto the organizer-level export
functionality. The ExportMixin in organizer.py had the identical issue
where test_form.cleaned_data was accessed without checking if the form
validation succeeded first.

This prevents potential HTTP 500 errors when accessing:
- /control/organizer/{organizer}/export/

Changes:
- Modified ExportMixin.exporters in control/views/organizer.py
- Added validation check before accessing test_form.cleaned_data
- Fallback to empty dict when form is invalid
- Use f-strings instead of string concatenation for better readability
- Rename 'id' variable to 'identifier' to avoid shadowing builtin
- Apply improvements to both orders.py and organizer.py

Addresses Sourcery suggestions...
- Add JSON_FIELD_AVAILABLE setting based on database backend (postgresql = True)
- Fix checkinlists exporter using old Event.items instead of Event.products
- Resolves AttributeError when accessing export functionality
- Changed from if/else validation check to getattr() to preserve partial cleaned_data
- This allows useful defaults even when form is partially invalid
- Reverted unnecessary 'id' to 'identifier' rename in organizer.py
- Renamed 'items' field to 'products' in checkinlists exporter for consistency
- Updated form_data['items'] to form_data['products'] reference
…fossasia#1157)

* Fix navigation button border radius inconsistency

- Added border-radius: 0 to .header-nav class in orga/_layout.css
- Makes Talk component navigation buttons match Tickets component style
- Ensures consistent sharp corners across all navigation buttons
- Maintains visual consistency throughout the platform

Fixes fossasia#1156

* Add inset shadow on hover to match Tickets component

- Added hover and active states with inset box-shadow
- Matches the hover effect from btn-success in Tickets component
- Uses rgba(0, 128, 0, 0.25) for green inset shadow

* Fix navigation button active state to match Tickets component

- Added .header-nav.active state with proper inset shadow
- Fixed depth and consistency of hover, active, and current page states
- Current page button now has same darker border effect as Tickets
- All navigation buttons now have identical visual feedback

* Improve CSS: use variables and remove important declarations

* Fix CSS indentation formatting

* Update app/eventyay/static/orga/css/_layout.css

* Update app/eventyay/static/orga/css/_layout.css

* Fix navigation buttons: sharp corners and inset shadow to match Tickets component

---------

Co-authored-by: Mario Behling <[email protected]>
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.

mariobehling and others added 2 commits November 30, 2025 19:07
@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?

Sak1012 and others added 12 commits December 1, 2025 09:42
…speaker-acceptance-link-oof

Fix Speaker Acceptance Confirmation Link Returning 500 Error
* fix(translations): Add missing languages

* add(translation): Change language selection to drop down from check-box

* fix(translation): Add changes suggested by ai comments

* fix(translation): Updated Ukrainian to use the standard Django code `uk`

---------

Co-authored-by: Mario Behling <[email protected]>
…4.* (fossasia#1401)

Updates the requirements on [beautifulsoup4](https://www.crummy.com/software/BeautifulSoup/bs4/) to permit the latest version.

---
updated-dependencies:
- dependency-name: beautifulsoup4
  dependency-version: 4.14.3
  dependency-type: direct:production
...

Signed-off-by: Mario Behling <[email protected]>
…sia#1400)

Updates the requirements on [celery](https://github.com/celery/celery) to permit the latest version.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst)
- [Commits](celery/celery@v5.4.0rc1...v5.6.0)

---
updated-dependencies:
- dependency-name: celery
  dependency-version: 5.6.0
  dependency-type: direct:production
...

Signed-off-by: Mario Behling <[email protected]>
@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

@htssp
Copy link
Author

htssp commented Dec 5, 2025

Hi @mariobehling, I have updated the language list as requested:

Removed “inofficial translation” / “translation in progress”
Renamed “Brazilian Portuguese” → “Portuguese (Brazil)”
Alphabetized languages (German, Finnish, Polish, etc.)
Removed duplicate Malay entry
English remains on the top as default

Screenshot
image

Please review and let me know if further adjustments are needed. Thanks!

@htssp htssp requested a review from mariobehling December 5, 2025 10:14
@mariobehling
Copy link
Member

Hi @htssp Thanks for your contribution. The branch had to be force pushed for development reasons and this PR is out of date. It would be great if you resolved the issues mentioned above and make a new PR. Closing this PR therefore.

@github-project-automation github-project-automation bot moved this from Backlog to Done in Eventyay Next Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

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