FIX: Translation missing for Norway (#196)

Turns out in YAML `NO` is interpreted as a boolean value, so we need to
wrap it in quotes.
This commit is contained in:
Blake Erickson 2024-03-27 15:50:15 -06:00 committed by GitHub
parent 0d28c9a56d
commit 9190001a3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -298,7 +298,7 @@ en:
NU: "Niue"
NF: "Norfolk Island"
MP: "Northern Mariana Islands"
NO: "Norway"
"NO": "Norway"
OM: "Oman"
PK: "Pakistan"
PW: "Palau"

View File

@ -2,6 +2,7 @@ import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import pretender, { response } from "discourse/tests/helpers/create-pretender";
import { acceptance, count } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
import { stubStripe } from "discourse/plugins/discourse-subscriptions/helpers/stripe";
function singleProductPretender() {
@ -49,4 +50,17 @@ acceptance("Discourse Subscriptions", function (needs) {
assert.dom("input.subscribe-promo-code").exists();
assert.dom("button.btn-payment").exists();
});
// In YAML `NO:` is a boolean, so we need quotes around `"NO":`.
test("Norway is translated correctly", async function (assert) {
assert.equal(
I18n.t("discourse_subscriptions.subscribe.countries.NO"),
"Norway"
);
assert.equal(
I18n.t("discourse_subscriptions.subscribe.countries.NG"),
"Nigeria"
);
});
});