Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the sr locale override .rb files #25927

Merged
merged 1 commit into from Jul 26, 2023

Conversation

mjankowski
Copy link
Contributor

History here:

2019-06 - Files added to Mastodon: #11061

Same Day - Details of the issue added on upstream: svenfuchs/rails-i18n#853

2021-05 - Upstream fix: https://github.com/svenfuchs/rails-i18n/pull/925/files

2022-01 - Upstream fix part two: https://github.com/svenfuchs/rails-i18n/pull/972/files

2022-02 - Upstream release with fixes: https://github.com/svenfuchs/rails-i18n/blob/master/CHANGELOG.md#702-2022-02-12

It looks like these files were only in place to nudge the pluralization rules, which have since been fixed in rails-i18n.

There were no specs added with the original change - #11061 - although there were subsequently specs added (around locale recognition, not correct pluralization) which do use sr-Latn. Because of that, I'm sort of taking the word of those PRs that this fixes the issue. Not totally necessary, but would be nice to add a spec here showing the behavior that our config was putting in place and double check that it still works now on newer rails-i18n version. Happy to do that if I can get some guidance on what was failing originally (looks like many pluralizations?). I did some locale console testing to be sure that some translations using counts in both locales still worked.

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions
Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@ClearlyClaire
Copy link
Contributor

ClearlyClaire commented Jul 12, 2023

Thanks for digging into this!

Note that this was supposedly fixed in rails-i18n 7.0.2, and we are still using 6.0.0, so the PR as is would reintroduce the issue.

@mjankowski
Copy link
Contributor Author

Note that this was supposedly fixed in rails-i18n 7.0.2, and we are still using 6.0.0, so the PR as is would reintroduce the issue.

We'll that's amusing. Will update with version bump.

Any guess on a spec which would expose the regression?

@mjankowski
Copy link
Contributor Author

We'll that's amusing. Will update with version bump.

Added the version bump, but hold off on merge, doing more research here.

@mjankowski
Copy link
Contributor Author

Any guess on a spec which would expose the regression?

I looked into this more and can't figure out what spec to add to catch the regression.

The places which use the many: key in the actual translations file are:

  • The datetime.distance_in_words scope
  • The generic errors scope

It looks like at least for these locales (and it appears most/all others) we are overriding the datetime one with values that never hit the pluralization keys.

For the latter errors ones, both locales do have a many key (from the gem) defined, whose values are the same as other, which I'm assuming is a compatibility thing, and/or just wasn't cleaned up. If I just do some console work and translate errors.messages.too_long for example, the output looks like what I'd expect based on the locale files. There are not inflections defined for either locale, so I assume its not the pluralize/singularize route.

All of that is to say -- I suspect that removing these files along with the version bump of the gem is likely fine and will get the correct pluralization treatment; but without knowing the initial issue we were solving, I'm not totally sure.

@Gargron I realize this was ~4 years ago - but do you have any more specific memory of what the original thing being solved here was; or if not - do you have an opinion one way or the other on my summary of the history here?

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

History here:

2019-06 - Files added to Mastodon: mastodon#11061

Same Day - Details of the issue added on upstream: svenfuchs/rails-i18n#853

2021-05 - Upstream fix: https://github.com/svenfuchs/rails-i18n/pull/925/files

2022-01 - Upstream fix part two: https://github.com/svenfuchs/rails-i18n/pull/972/files

2022-02 - Upstream release with fixes: https://github.com/svenfuchs/rails-i18n/blob/master/CHANGELOG.md#702-2022-02-12

It looks like these files were only in place to nudge the pluralization
rules, which have since been fixed in `rails-i18n`.
@mjankowski
Copy link
Contributor Author

Rebased against main, which now includes the version bump already.

@github-actions
Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@ClearlyClaire
Copy link
Contributor

Any guess on a spec which would expose the regression?

I suppose calling something like I18n.t('accounts.followers', count: 530, locale: :'sr-Latn') and checking the result would work, but it's too tied to actual translations for my liking.

The places which use the many: key in the actual translations file are:

* The `datetime.distance_in_words` scope

* The generic `errors` scope

I'm confused, I'm unable to find any of those uses.

@mjankowski
Copy link
Contributor Author

I suppose calling something like I18n.t('accounts.followers', count: 530, locale: :'sr-Latn') and checking the result would work, but it's too tied to actual translations for my liking.

Yup, I had some hesitation on those -- but also, because I wasn't sure if the original issue was just a wrong translation or an error being raised or something else, I wasn't sure what to actually check there.

The places which use the many: key in the actual translations file are:

* The `datetime.distance_in_words` scope

* The generic `errors` scope

I'm confused, I'm unable to find any of those uses.

Datetime example that gets overridden and not actually pluralized - https://github.com/mastodon/mastodon/blob/main/config/locales/en.yml#L1092

The errors ones are in the gem -- https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml#L134

@ClearlyClaire ClearlyClaire merged commit b06763d into mastodon:main Jul 26, 2023
27 checks passed
@mjankowski mjankowski deleted the remove-locale-sr-files branch July 26, 2023 14:39
ClearlyClaire added a commit to glitch-soc/mastodon that referenced this pull request Jul 30, 2023
* Cleanup unused portions of statuses/status partial (mastodon#26045)

* Wrong count in response when removing favourite/reblog (mastodon#24365)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Paperclip: add support for Azure blob storage (mastodon#23607)

* Fix a missing redirection on getting-started in multi column mode (mastodon#26070)

* Fix haml-lint Rubocop `Style/NumericPredicate` cop (mastodon#26040)

* Change casing for 'Server Settings' string (mastodon#26011)

* Move localized subject mailer shared example to separate file (mastodon#25889)

* Fix haml-lint Rubocop `Lint/UnusedBlockArguments` cop (mastodon#26039)

* Fix `Lint/Void` cop (mastodon#25922)

* Add stricter protocol fields validation for accounts (mastodon#25937)

* Improve the bug report templates (mastodon#25621)

* Fix the crossorigin attribute (mastodon#26096)

* Fix replica being used even if not explicitly defined (mastodon#26074)

* Clean up unused application records (mastodon#24871)

* Change thread view to scroll to the selected post rather than the post being replied to (mastodon#24685)

* Change default KeyGenerator digest to SHA1 to fix cookies in rolling upgrades (mastodon#26023)

* change focus ui for keyboard only input (mastodon#25935)

* Use username as display name for suspended users or users with blank display names (mastodon#25276)

* Fix CSP headers being unintendedly wide (mastodon#26105)

* Fix linting issue (mastodon#26106)

* Replace 'favourite' by 'favorite' for American English (mastodon#26009)

* Override default Action Mailer `preview_path` (mastodon#26110)

* Favourits -> Favorites (mastodon#26109)

* Bump version to v4.1.5 (mastodon#26108)

* Fix incorrect connect timeout in outgoing requests (mastodon#26116)

* Fix missing translation strings for importing lists (mastodon#26120)

* Use valid email address for first account (mastodon#26114)

* Update haml-lint 0.49.1 (mastodon#26118)

* Fix focus and hover styles in web UI (mastodon#26125)

* Remove back button from bookmarks, favourites and lists screens in web UI (mastodon#26126)

* Remove 16:9 cropping from web UI (mastodon#26132)

* Change design of link previews in web UI (mastodon#26136)

* change poll form element colors to fit with the rest of the ui (mastodon#26139)

* Add `lang` attribute to trending links (mastodon#26111)

* Update dependency rdf-normalize to v0.6.1 (mastodon#26130)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency brakeman to v6.0.1 (mastodon#26141)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency postcss to v8.4.27 (mastodon#26144)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix unexpected redirection to /explore after sign-in (mastodon#26143)

* Update dependency aws-sdk-s3 to v1.131.0 (mastodon#26145)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add report.updated webhook (mastodon#24211)

* Fix LinkCrawlWorker crashing on `null` `created_at` (mastodon#26151)

* Fix UI Overlap with the loupe icon in the Explore Tab (mastodon#26113)

* Fix missing border on error screen in light theme in web UI (mastodon#26152)

* Fix missing action label on sensitive videos and embeds in web UI (mastodon#26135)

* Fix `lang` for UI texts in link preview (mastodon#26149)

* Add published date and author to news on the explore screen in web UI (mastodon#26155)

* Coverage for `Auth::OmniauthCallbacks` controller (mastodon#26147)

* fix poll input active style (mastodon#26162)

* Add `published_at` attribute to preview cards (mastodon#26153)

* Update dependency sass to v1.64.1 (mastodon#26146)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Revert poll colors to green outside of compose form (mastodon#26164)

* Preserve translation on status re-import (mastodon#26168)

* Fix missing GIF badge in account gallery (mastodon#26166)

* Reformat large text arg in `FetchLinkCardService` spec (mastodon#26183)

* Ignore long line in regex initializer (mastodon#26182)

* Reformat large key values in service specs (mastodon#26181)

* Reformat large hash in `ContextHelper` module (mastodon#26180)

* Use heredoc SQL blocks in `AddFromAccountIdToNotifications` migration (mastodon#26178)

* Extract private methods in `StatusCacheHydrator` (mastodon#26177)

* New Crowdin Translations (automated) (mastodon#26072)

Co-authored-by: GitHub Actions <noreply@github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Remove the `sr` locale override .rb files (mastodon#25927)

* Use correct naming on controller concern specs (mastodon#26197)

* Migrate to request specs in `/api/v2/filters` (mastodon#25721)

* Fix wrong filters sometimes applying in streaming (mastodon#26159)

* Refactor streaming's filtering logic & improve documentation (mastodon#26213)

* Add role badges to the WebUI (mastodon#25649)

* Change interaction modal in web UI (mastodon#26075)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

* Fix crash when processing Flag activity with no status (mastodon#26189)

* Storage: add :azure to remaining callers (mastodon#26080)

* Remove queued_at value from pubsub payloads (mastodon#26173)

* Fix emoji picker button scrolling with textarea content in single-column view (mastodon#25304)

* Change the wording of the dismissable explore prompt (mastodon#25917)

* Update dependency haml_lint to v0.49.2 (mastodon#26222)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix: Streaming server memory leak in HTTP EventSource cleanup (mastodon#26228)

* Swap debug statements in streaming server (mastodon#26231)

* Fix missing return values in streaming (mastodon#26233)

* [Glitch] Wrong count in response when removing favourite/reblog

Port 4c18928 to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix a missing redirection on getting-started in multi column mode

Port 586b1c9 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Change thread view to scroll to the selected post rather than the post being replied to

Port e4ea80d to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Replace 'favourite' by 'favorite' for American English

Port 217ef7f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] change poll form element colors to fit with the rest of the ui

Port 80809ef to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Add `lang` attribute to trending links

Port 76fce34 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix UI Overlap with the loupe icon in the Explore Tab

Port 9a567ec to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix missing border on error screen in light theme in web UI

Port d1a9f60 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix missing action label on sensitive videos and embeds in web UI

Port 714a206 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] fix poll input active style

Port 49d2e89 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Revert poll colors to green outside of compose form

Port ce1f35d to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Add published date and author to news on the explore screen in web UI

Port f826a95 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Preserve translation on status re-import

Port 6781dc6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix missing GIF badge in account gallery

Port a4b69be to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* Fix interaction modal being broken because of glitch-soc's theming system

* [Glitch] Change interaction modal in web UI

Port b4e739f to glitch-soc

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Change the wording of the dismissable explore prompt

Port a4ec187 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* Fix CSP tests in glitch-soc

---------

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Matt Jankowski <matt@jankowski.online>
Co-authored-by: Christian Schmidt <github@chsc.dk>
Co-authored-by: Misty De Méo <mistydemeo@gmail.com>
Co-authored-by: Stanislas Signoud <signez@stanisoft.net>
Co-authored-by: gunchleoc <fios@foramnagaidhlig.net>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Co-authored-by: Trevor Wolf <teeerevor@gmail.com>
Co-authored-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Co-authored-by: mogaminsk <mgmnjp@icloud.com>
Co-authored-by: Nick Schonning <nschonni@gmail.com>
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vyr Cossont <VyrCossont@users.noreply.github.com>
Co-authored-by: gol-cha <info@mevo.xyz>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Co-authored-by: Daniel M Brasil <danielmbrasil@protonmail.com>
Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
Sign up for free to 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.

None yet

2 participants