Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1d88ca4

Browse files
authored
DEV: Use core's locale normalizer (#1509)
We've moved the class to core here discourse/discourse#33702 so following up a deletion in this repo.
1 parent 6059b6e commit 1d88ca4

File tree

6 files changed

+4
-95
lines changed

6 files changed

+4
-95
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.5.0.beta8-dev: 5d80a34589d63e381d80273828072badc18955b1
12
< 3.5.0.beta7-dev: cd14b0c0bee0cf63c59b64b6f7213e31a37f11a7
23
< 3.5.0.beta6-dev: 3e74eea1e5e3143888d67a8d8a11206df214dc24
34
< 3.5.0.beta3-dev: 09a68414804a1447f52e5d60691ba59742cda9ec

app/jobs/regular/detect_translate_post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def execute(args)
4040
return if locales.blank?
4141

4242
locales.each do |locale|
43-
next if DiscourseAi::Translation::LocaleNormalizer.is_same?(locale, detected_locale)
43+
next if LocaleNormalizer.is_same?(locale, detected_locale)
4444
regionless_locale = locale.split("_").first
4545
next if post.post_localizations.where("locale LIKE ?", "#{regionless_locale}%").exists?
4646

app/jobs/regular/detect_translate_topic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def execute(args)
3838
return if locales.blank?
3939

4040
locales.each do |locale|
41-
next if DiscourseAi::Translation::LocaleNormalizer.is_same?(locale, detected_locale)
41+
next if LocaleNormalizer.is_same?(locale, detected_locale)
4242
regionless_locale = locale.split("_").first
4343
next if topic.topic_localizations.where("locale LIKE ?", "#{regionless_locale}%").exists?
4444

app/jobs/regular/localize_categories.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def execute(args)
2929
missing_locales = locales - existing_locales - [category.locale]
3030
missing_locales.each do |locale|
3131
break if remaining_limit <= 0
32-
next if DiscourseAi::Translation::LocaleNormalizer.is_same?(locale, category.locale)
32+
next if LocaleNormalizer.is_same?(locale, category.locale)
3333

3434
begin
3535
DiscourseAi::Translation::CategoryLocalizer.localize(category, locale)

lib/translation/locale_normalizer.rb

Lines changed: 0 additions & 50 deletions
This file was deleted.

spec/lib/translation/locale_normalizer_spec.rb

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)