diff --git a/tests/validate-cms.spec.js b/__tests__/validate-cms.spec.js similarity index 100% rename from tests/validate-cms.spec.js rename to __tests__/validate-cms.spec.js diff --git a/cms/top-announcement-banner.json b/cms/top-announcement-banner.json index 7a1a5ed..ccf9d5f 100644 --- a/cms/top-announcement-banner.json +++ b/cms/top-announcement-banner.json @@ -2,9 +2,9 @@ "$schema": "../schemas/top-announcement-banner.schema.json", "isChainHalted": false, "banner": { - "enTextOrLocalizationPath": "This is a test of the top announcement banner.", + "enTextOrLocalizationPath": "topAnnouncementBanner.title", "link": { - "enTextOrLocalizationKey": "Click here to learn more.", + "enTextOrLocalizationKey": "topAnnouncementBanner.linkLearnMore", "isExternal": true, "url": "https://www.google.com" }, diff --git a/localizations/en.json b/localizations/en.json new file mode 100644 index 0000000..dbf7e5f --- /dev/null +++ b/localizations/en.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Testing!", + "linkLearnMore": "Click here to learn more." + } +} diff --git a/localizations/es.json b/localizations/es.json new file mode 100644 index 0000000..605b515 --- /dev/null +++ b/localizations/es.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "¡Pruebas!", + "linkLearnMore": "Clic aquí para saber más." + } +} diff --git a/localizations/fa.json b/localizations/fa.json new file mode 100644 index 0000000..1268b54 --- /dev/null +++ b/localizations/fa.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "آزمایش کردن!", + "linkLearnMore": "برای اطلاعات بیشتر اینجا کلیک کنید." + } +} diff --git a/localizations/fr.json b/localizations/fr.json new file mode 100644 index 0000000..6e53e4a --- /dev/null +++ b/localizations/fr.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Essai!", + "linkLearnMore": "Cliquez ici pour en savoir plus." + } +} diff --git a/localizations/ko.json b/localizations/ko.json new file mode 100644 index 0000000..f8f49f0 --- /dev/null +++ b/localizations/ko.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "테스트!", + "linkLearnMore": "자세한 내용을 보려면 여기를 클릭하세요." + } +} diff --git a/localizations/pl.json b/localizations/pl.json new file mode 100644 index 0000000..6ea30da --- /dev/null +++ b/localizations/pl.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Testowanie!", + "linkLearnMore": "Kliknij tutaj, aby dowiedzieć się więcej." + } +} diff --git a/localizations/pt-br.json b/localizations/pt-br.json new file mode 100644 index 0000000..6885eef --- /dev/null +++ b/localizations/pt-br.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Testando!", + "linkLearnMore": "Clique aqui para saber mais." + } +} diff --git a/localizations/ro.json b/localizations/ro.json new file mode 100644 index 0000000..577e461 --- /dev/null +++ b/localizations/ro.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Testare!", + "linkLearnMore": "Apasa aici pentru a afla mai multe." + } +} diff --git a/localizations/tr.json b/localizations/tr.json new file mode 100644 index 0000000..a2bc7ad --- /dev/null +++ b/localizations/tr.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "Test yapmak!", + "linkLearnMore": "Daha fazlasını öğrenmek için buraya tıklayın." + } +} diff --git a/localizations/zh-cn.json b/localizations/zh-cn.json new file mode 100644 index 0000000..2c671c5 --- /dev/null +++ b/localizations/zh-cn.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "测试!", + "linkLearnMore": "点击这里了解更多。" + } +} diff --git a/localizations/zh-hk.json b/localizations/zh-hk.json new file mode 100644 index 0000000..c087cec --- /dev/null +++ b/localizations/zh-hk.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "測試!", + "linkLearnMore": "點這裡了解更多。" + } +} diff --git a/localizations/zh-tw.json b/localizations/zh-tw.json new file mode 100644 index 0000000..c087cec --- /dev/null +++ b/localizations/zh-tw.json @@ -0,0 +1,6 @@ +{ + "topAnnouncementBanner": { + "title": "測試!", + "linkLearnMore": "點這裡了解更多。" + } +} diff --git a/package.json b/package.json index cad26fa..eaa75ad 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "test": "vitest" + "test": "vitest", + "machine-translate": "inlang machine translate --project ./project.inlang" }, "keywords": [], "author": "", @@ -13,6 +14,7 @@ "ajv": "^8.12.0", "ajv-cli": "^5.0.0", "ajv-formats": "^2.1.1", - "vitest": "^1.1.3" + "vitest": "^1.1.3", + "@inlang/cli": "^2.0.0" } } diff --git a/project.inlang/settings.json b/project.inlang/settings.json new file mode 100644 index 0000000..b378f42 --- /dev/null +++ b/project.inlang/settings.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://inlang.com/schema/project-settings", + "sourceLanguageTag": "en", + "languageTags": [ + "en", + "es", + "fa", + "fr", + "ko", + "pl", + "pt-br", + "ro", + "tr", + "zh-cn", + "zh-hk", + "zh-tw" + ], + "modules": [ + "https://cdn.jsdelivr.net/npm/@inlang/plugin-json@4/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@1/dist/index.js" + ], + "plugin.inlang.json": { + "pathPattern": "./localizations/{languageTag}.json" + } +} diff --git a/yarn.lock b/yarn.lock index 68ef436..1af92ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -117,6 +117,14 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== +"@inlang/cli@^2.0.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@inlang/cli/-/cli-2.4.0.tgz#271e9201083e938a9563610e9416c3170c87e261" + integrity sha512-7Ev0x0w/S+PJlHyLC2RPRQNHppaU9ZxGKqtCm8jFplXqFxrlL7uU3z5+cyRM6u1jthd3smx1D0PlYcCJW9tU1Q== + dependencies: + esbuild-wasm "^0.19.2" + fs-extra "11.1.1" + "@jest/schemas@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" @@ -376,6 +384,11 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== +esbuild-wasm@^0.19.2: + version "0.19.11" + resolved "https://registry.yarnpkg.com/esbuild-wasm/-/esbuild-wasm-0.19.11.tgz#4ed96cdd1a289bc08432a25fd38b7331d3eac98d" + integrity sha512-MIhnpc1TxERUHomteO/ZZHp+kUawGEc03D/8vMHGzffLvbFLeDe6mwxqEZwlqBNY7SLWbyp6bBQAcCen8+wpjQ== + esbuild@^0.19.3: version "0.19.11" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" @@ -449,6 +462,15 @@ fast-json-patch@^2.0.0: dependencies: fast-deep-equal "^2.0.1" +fs-extra@11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" + integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -481,6 +503,11 @@ glob@^7.1.0: once "^1.3.0" path-is-absolute "^1.0.0" +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + human-signals@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" @@ -539,6 +566,15 @@ jsonc-parser@^3.2.0: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + local-pkg@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.0.tgz#093d25a346bae59a99f80e75f6e9d36d7e8c925c" @@ -804,6 +840,11 @@ ufo@^1.3.0: resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.2.tgz#c7d719d0628a1c80c006d2240e0d169f6e3c0496" integrity sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA== +universalify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"