-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
55 changed files
with
2,338 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MaputnikDriver } from "./maputnik-driver"; | ||
|
||
describe("i18n", () => { | ||
let { beforeAndAfter, get, when, then } = new MaputnikDriver(); | ||
beforeAndAfter(); | ||
|
||
describe("language detector", () => { | ||
it("English", () => { | ||
const url = "?lng=en"; | ||
when.visit(url); | ||
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("en"); | ||
}); | ||
|
||
it("Japanese", () => { | ||
const url = "?lng=ja"; | ||
when.visit(url); | ||
then(get.elementByTestId("maputnik-lang-select")).shouldHaveValue("ja"); | ||
}); | ||
}); | ||
|
||
describe("language switcher", () => { | ||
beforeEach(() => { | ||
when.setStyle("layer"); | ||
}); | ||
|
||
it("the language switcher switches to Japanese", () => { | ||
const selector = "maputnik-lang-select"; | ||
then(get.elementByTestId(selector)).shouldExist(); | ||
when.select(selector, "ja"); | ||
then(get.elementByTestId(selector)).shouldHaveValue("ja"); | ||
|
||
then(get.elementByTestId("nav:settings")).shouldHaveText("スタイル設定"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
output: 'src/locales/$LOCALE/$NAMESPACE.json', | ||
locales: [ 'ja', 'he' ], | ||
|
||
// Because some keys are dynamically generated, i18next-parser can't detect them. | ||
// We add these keys manually, so we don't want to remove them. | ||
keepRemoved: true, | ||
|
||
// We use plain English keys, so we disable key and namespace separators. | ||
keySeparator: false, | ||
namespaceSeparator: false, | ||
|
||
defaultValue: (locale, ns, key) => { | ||
// The default value is a string that indicates that the string is not translated. | ||
return '__STRING_NOT_TRANSLATED__'; | ||
} | ||
} |
Oops, something went wrong.