Moin
21.Июль.2024 15:39:37
1
Продолжение обсуждения из Проблема с переопределением перевода множественного числа (count) :
Я считаю, что венгерский язык — не единственный, затронутый этой проблемой. Проверив иврит из-за этого #бага , упоминающего проблемы, я подумал, что, возможно, затронуты ещё больше языков, поэтому начал искать дополнительные случаи.
const a = (n) => n == 1 ? 'one' : 'other';
const b = (n) => (n == 0 || n == 1) ? 'one' : 'other';
const c = (n) => n >= 0 && n <= 1 ? 'one' : 'other';
const d = (n) => {
const s = String(n).split('.'), v0 = !s[1];
return n == 1 && v0 ? 'one' : 'other';
};
const e = (n) => 'other';
const f = (n, c) => {
const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
return n == 1 && v0 ? 'one'
: !c && i != 0 && i1000000 == 0 && v0 || c > 5 ? 'many'
: 'other';
};
const g = (n) => n == 1 ? 'one'
: n == 2 ? 'two'
: 'other';
export const af = a;
export const ak = b;
This file has been truncated. show original
Найдя ещё один случай, я предполагаю, что затронуты ещё больше языков.
2 лайка
david
(David Taylor)
22.Июль.2024 12:10:29
3
Спасибо @Moin !
Я внес это изменение , чтобы остановить проблему. Это ограничит влияние сбоев компиляции, так что они будут затрагивать только строки _MF, а не выводить весь сайт из строя.
Мы продолжим искать первопричину и обновим информацию здесь, как только найдем решение.
11 лайков
loic
(Loïc Guitaut)
25.Июль.2024 12:32:05
5
Мы только что объединили патч, который ослабляет компилятор MessageFormat, разрешая некорректные ключи множественного числа в сообщениях:
main ← loic-handle-bad-mf-pluralization-rules
merged 12:16PM - 25 Jul 24 UTC
We can get translations with invalid plural keys from Crowdin or from custom ove… rrides. Currently, this will raise an error and the locales won’t be outputted at all.
This PR addresses this issue by using the new `strict: false` option of our `messageformat-wrapper` gem, allowing to generate locales even if there are invalid plural keys present.
Это должно решить большинство проблем. Другие патчи должны появиться в ближайшее время.
5 лайков
loic
(Loïc Guitaut)
26.Июль.2024 10:27:35
6
Недавно было объединено ещё одно исправление:
main ← loic-validate-translation-overrides
merged 10:20AM - 26 Jul 24 UTC
Currently, when adding translation overrides, values aren’t validated for MF str… ings. This results in being able to add invalid plural keys or even strings containing invalid syntax.
This PR addresses this issue by compiling the string when saving an override if the key is detected as an MF one.
If there’s an error from the compiler, it’s added to the model errors, which in turn is displayed to the user in the admin UI, helping them to understand what went wrong.
----


Это предотвратит создание недопустимых переопределений MF в интерфейсе администратора.
5 лайков
loic
(Loïc Guitaut)
29.Июль.2024 13:46:20
7
Только что объединили этот PR:
main ← loic-update-ruby-i18n-pluralization-rules
merged 01:44PM - 29 Jul 24 UTC
The current pluralization rules used by the I18n system in Ruby are obsolete and… don’t follow the official rules available at https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html.
Using https://github.com/ruby-i18n/ruby-cldr, new and updated ones have been generated.
Правила множественного числа в Ruby теперь должны быть актуальными и соответствовать тем, что у нас в JS
4 лайка
j.jaffeux
(Joffrey Jaffeux)
Закрыл(а) тему
03.Август.2024 13:46:38
8
Эта тема была автоматически закрыта через 5 дней после последнего ответа. Новые ответы больше не допускаются.