Polish locale problem

Hey guys,

I’ve just installed Discourse (2.5.0.beta7) and I’m trying to use it with Polish language.

At the top of every page I’m getting:

Invalid Format: Uncaught SyntaxError: Expected “plural” or “select” but “l” found. at undefined:1376:10

That doesn’t show up when I’m using English language settings so I believe this has something to do with Polish translation.

Any hint how to get rid of it?

3 Likes

Anything we can quick fix for the coming week @gerhard?

3 Likes

The Polish locale had lots of MessageFormat errors, but other locales were affected too.

List of errors
bundle exec rake i18n:check

================================================================================
config/locales/client.bs_BA.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "," or "}" but "s" found.

================================================================================
config/locales/client.ca.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "<" found.

================================================================================
config/locales/client.da.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0

================================================================================
config/locales/client.it.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0

================================================================================
config/locales/client.ko.yml
================================================================================
js.too_few_topics_and_posts_notice_MF -- Invalid message format: Uncaught SyntaxError: Expected "{" but "<" found.
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected ",", "}" or [^ \t\n\r,.+={}] but end of input found.
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected ",", "}" or [^ \t\n\r,.+={}] but end of input found.
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "offset", "}" or [a-zA-Z$_] but "<" found.
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected [a-zA-Z$_] but "0" found.

================================================================================
config/locales/client.pl_PL.yml
================================================================================
js.too_few_topics_and_posts_notice_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.too_few_topics_notice_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.too_few_posts_notice_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "plural" or "select" but "l" found.
js.posts_likes_MF -- Invalid message format: Uncaught SyntaxError: Expected "," but "l" found.

================================================================================
config/locales/client.pt.yml
================================================================================
js.flagging.delete_confirm_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0

================================================================================
config/locales/client.ru.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0438" found.
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0438" found.
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0438" found.
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0438" found.

================================================================================
config/locales/client.sw.yml
================================================================================
js.flagging.delete_confirm_MF -- Invalid message format: Uncaught SyntaxError: Expected "," or "}" but "m" found.
admin_js.admin.user.delete_all_posts_confirm_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0

================================================================================
config/locales/client.tr_TR.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "{" found.
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Error: No 'other' form found in pluralFormatPattern 0
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "{" found.

================================================================================
config/locales/client.uk.yml
================================================================================
js.logs_error_rate_notice.reached_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0430" found.
js.logs_error_rate_notice.reached_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0430" found.
js.logs_error_rate_notice.exceeded_hour_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0430" found.
js.logs_error_rate_notice.exceeded_minute_MF -- Invalid message format: Uncaught SyntaxError: Expected "=", "}" or [a-zA-Z$_] but "%u0430" found.

I fixed all of those on Transifex by either deleting the invalid translation or fixing them if there was a simple, easy to detect mistake. I’m looking forward to Crowdin which has QA checks for MessageFormat strings.

All translations have been updated on Github, so the problem should be gone after updating to latest.

7 Likes