├── .mocharc.yml ├── .yarnrc ├── .gitattributes ├── examples ├── by-features │ ├── 100-locales │ │ ├── locales │ │ │ ├── he.yml │ │ │ ├── es.yml │ │ │ ├── ca.yml │ │ │ ├── ja.yml │ │ │ ├── ko.yml │ │ │ ├── zh-cn.yml │ │ │ ├── zh-hk.yml │ │ │ ├── zh-sg.yml │ │ │ ├── zh-tw.yml │ │ │ ├── af.yml │ │ │ ├── am.yml │ │ │ ├── cy.yml │ │ │ ├── es-ar.yml │ │ │ ├── et.yml │ │ │ ├── hr.yml │ │ │ ├── mk.yml │ │ │ ├── mt.yml │ │ │ ├── ne.yml │ │ │ ├── pt-br.yml │ │ │ ├── ru.yml │ │ │ ├── th.yml │ │ │ ├── aq.yml │ │ │ ├── be.yml │ │ │ ├── en-ca.yml │ │ │ ├── en-uk.yml │ │ │ ├── gd.yml │ │ │ ├── no-no.yml │ │ │ ├── vi.yml │ │ │ ├── de.yml │ │ │ ├── fr-fr.yml │ │ │ ├── mn.yml │ │ │ └── en-us.yml │ │ ├── package.json │ │ ├── README.md │ │ └── app.js │ ├── extractions │ │ ├── .eslintignore │ │ ├── a.tsx │ │ ├── package.json │ │ ├── Demo.vue │ │ ├── locales │ │ │ └── en.json │ │ └── Demo2.vue │ ├── tag-system-bcp47 │ │ ├── locales │ │ │ ├── de.yml │ │ │ ├── de-de.yml │ │ │ ├── zh-cn.yml │ │ │ ├── zh-hk.yml │ │ │ ├── zh-sg.yml │ │ │ ├── zh-tw.yml │ │ │ ├── de-DE-bavarian.yml │ │ │ └── en.yml │ │ ├── app.js │ │ ├── package.json │ │ ├── README.md │ │ └── .vscode │ │ │ └── settings.json │ ├── yaml │ │ ├── locales │ │ │ ├── zh-cn.yml │ │ │ ├── ja.yaml │ │ │ └── en.yml │ │ ├── package.json │ │ └── App.vue │ ├── collections │ │ ├── locales │ │ │ ├── ja.json │ │ │ └── en.json │ │ ├── .vscode │ │ │ └── settings.json │ │ └── package.json │ ├── path-matcher │ │ ├── namespaces-locale │ │ │ ├── i18n │ │ │ │ ├── en.yml │ │ │ │ ├── general │ │ │ │ │ ├── en.yml │ │ │ │ │ └── fr.yml │ │ │ │ └── foo │ │ │ │ │ ├── bar │ │ │ │ │ ├── en.yml │ │ │ │ │ └── fr.yml │ │ │ │ │ ├── en.yml │ │ │ │ │ └── fr.yml │ │ │ ├── package.json │ │ │ ├── App.vue │ │ │ └── .vscode │ │ │ │ └── settings.json │ │ └── locale-namespaces │ │ │ ├── i18n │ │ │ ├── en │ │ │ │ ├── general.yml │ │ │ │ ├── foo │ │ │ │ │ └── bar.yml │ │ │ │ └── foo.yml │ │ │ └── fr │ │ │ │ ├── general.yml │ │ │ │ ├── foo │ │ │ │ └── bar.yml │ │ │ │ └── foo.yml │ │ │ ├── package.json │ │ │ ├── App.vue │ │ │ └── .vscode │ │ │ └── settings.json │ ├── js-parser-dir │ │ ├── locales │ │ │ ├── en │ │ │ │ ├── a.ts │ │ │ │ ├── b.ts │ │ │ │ └── index.ts │ │ │ └── zh-cn │ │ │ │ ├── a.ts │ │ │ │ ├── b.ts │ │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── package.json │ │ └── App.vue │ ├── module-style │ │ ├── modules │ │ │ ├── moduleA │ │ │ │ └── locales │ │ │ │ │ ├── fr.json │ │ │ │ │ ├── zh-cn.json │ │ │ │ │ └── en.json │ │ │ ├── moduleB │ │ │ │ └── locales │ │ │ │ │ ├── fr.json │ │ │ │ │ ├── zh-cn.json │ │ │ │ │ └── en.json │ │ │ └── moduleC │ │ │ │ └── nested │ │ │ │ └── locales │ │ │ │ ├── fr.json │ │ │ │ ├── zh-cn.json │ │ │ │ └── en.json │ │ ├── package.json │ │ └── App.vue │ ├── dir-locales │ │ ├── locales │ │ │ ├── en │ │ │ │ ├── a.json │ │ │ │ ├── b.json │ │ │ │ └── index.js │ │ │ ├── ja │ │ │ │ ├── a.json │ │ │ │ ├── b.json │ │ │ │ └── index.js │ │ │ └── zh-cn │ │ │ │ ├── a.json │ │ │ │ ├── b.json │ │ │ │ └── index.js │ │ ├── App.vue │ │ ├── .vscode │ │ │ └── settings.json │ │ └── package.json │ ├── custom-scope-range │ │ ├── public │ │ │ ├── locales │ │ │ │ └── en │ │ │ │ │ ├── pages │ │ │ │ │ └── home.json │ │ │ │ │ └── translation.json │ │ │ └── index.html │ │ ├── src │ │ │ ├── customScopeRange.js │ │ │ ├── App.css │ │ │ ├── index.js │ │ │ └── i18n.js │ │ ├── .vscode │ │ │ ├── i18n-ally-custom-framework.yml │ │ │ └── settings.json │ │ └── package.json │ ├── flatten-scope-conflict │ │ ├── lang │ │ │ ├── ja.yml │ │ │ └── en.json │ │ ├── package.json │ │ └── index.js │ ├── js-parser │ │ ├── locales │ │ │ ├── ja.js │ │ │ ├── zh_cn.js │ │ │ ├── fr.ts │ │ │ └── en.ts │ │ ├── tsconfig.json │ │ ├── package.json │ │ ├── .vscode │ │ │ └── settings.json │ │ └── App.vue │ ├── encoding │ │ ├── locales │ │ │ ├── ko.yml │ │ │ ├── de.json │ │ │ ├── fr.json │ │ │ ├── ja.json │ │ │ ├── en-us.json │ │ │ ├── zh-cn.json │ │ │ ├── zh-tw.json │ │ │ └── en.json │ │ ├── package.json │ │ └── Demo.vue │ ├── linked │ │ ├── locales │ │ │ ├── ja.json │ │ │ ├── zh-cn.yml │ │ │ ├── ko.yml │ │ │ ├── nl-nl.ini │ │ │ ├── fr.json │ │ │ └── en.json │ │ ├── package.json │ │ └── Demo.vue │ ├── flatten-mode │ │ ├── lang │ │ │ ├── ja.yml │ │ │ ├── zh-cn.json │ │ │ └── en.json │ │ └── package.json │ ├── demo │ │ ├── locales │ │ │ ├── ja.json │ │ │ ├── ko.yml │ │ │ ├── zh-cn.yml │ │ │ ├── fr.json │ │ │ └── en.json │ │ ├── package.json │ │ ├── .vscode │ │ │ └── settings.json │ │ └── Demo.vue │ ├── custom-locales-path │ │ ├── lang │ │ │ ├── zh-cn.json │ │ │ └── ja.json │ │ └── package.json │ └── json5 │ │ ├── .vscode │ │ └── settings.json │ │ ├── locales │ │ ├── zh-cn.json5 │ │ └── ja.my-custom-ext │ │ └── package.json ├── by-frameworks │ ├── non-i18n-project │ │ ├── locales │ │ │ ├── ja.json │ │ │ ├── zh-cn.json │ │ │ └── en.json │ │ ├── package.json │ │ └── App.vue │ ├── custom │ │ ├── index.ts │ │ ├── package.json │ │ ├── .vscode │ │ │ ├── settings.json │ │ │ └── i18n-ally-custom-framework.yml │ │ ├── App.vue │ │ └── locales │ │ │ └── en.json │ ├── ember │ │ ├── locales │ │ │ ├── zh-cn.json │ │ │ └── en.json │ │ ├── package.json │ │ ├── template.hbs │ │ └── .vscode │ │ │ └── settings.json │ ├── fluent-vue-sfc │ │ ├── i18n │ │ │ └── en.ftl │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── src │ │ │ ├── index.js │ │ │ └── fluent.js │ │ └── package.json │ ├── ui5 │ │ ├── webapp │ │ │ ├── manifest.json │ │ │ ├── i18n │ │ │ │ ├── i18n_ar.properties │ │ │ │ └── i18n_en.properties │ │ │ ├── App.view.xml │ │ │ ├── index.js │ │ │ └── App.controller.js │ │ ├── package.json │ │ └── .vscode │ │ │ └── settings.json │ ├── vue-i18n-sfc │ │ ├── locales │ │ │ ├── ja.json │ │ │ └── en.json │ │ ├── babel.config.js │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── vue.config.js │ │ ├── src │ │ │ └── main.js │ │ └── package.json │ ├── flutter │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── .gitignore │ │ ├── pubspec.yaml │ │ └── assets │ │ │ └── i18n │ │ │ ├── it.json │ │ │ ├── en.yaml │ │ │ └── es.json │ ├── i18next-shopify │ │ ├── public │ │ │ ├── locales │ │ │ │ ├── en │ │ │ │ │ ├── pages │ │ │ │ │ │ └── home.json │ │ │ │ │ └── translation.json │ │ │ │ └── de │ │ │ │ │ ├── pages │ │ │ │ │ └── home.json │ │ │ │ │ └── translation.json │ │ │ └── index.html │ │ ├── src │ │ │ ├── index.css │ │ │ ├── App.css │ │ │ └── index.js │ │ └── .vscode │ │ │ └── settings.json │ ├── jekyll │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── _i18n │ │ │ ├── en.yml │ │ │ └── fr.yml │ │ ├── Gemfile │ │ └── _pages │ │ │ └── 404.html │ ├── next-translate │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── locales │ │ │ ├── en │ │ │ │ ├── common.json │ │ │ │ ├── dynamic.json │ │ │ │ └── home.json │ │ │ ├── es │ │ │ │ ├── common.json │ │ │ │ ├── dynamic.json │ │ │ │ └── home.json │ │ │ └── ca │ │ │ │ ├── common.json │ │ │ │ ├── dynamic.json │ │ │ │ └── home.json │ │ ├── pages_ │ │ │ └── _app.js │ │ ├── i18n.json │ │ └── components │ │ │ └── no-functional-component.js │ ├── react-i18next │ │ ├── public │ │ │ ├── locales │ │ │ │ ├── de │ │ │ │ │ ├── pages │ │ │ │ │ │ └── home.json │ │ │ │ │ └── translation.json │ │ │ │ └── en │ │ │ │ │ ├── pages │ │ │ │ │ └── home.json │ │ │ │ │ └── translation.json │ │ │ └── index.html │ │ ├── src │ │ │ ├── index.css │ │ │ ├── App.css │ │ │ └── index.js │ │ └── .vscode │ │ │ └── settings.json │ ├── vuex-i18n │ │ └── todo-demo │ │ │ ├── app │ │ │ ├── store │ │ │ │ ├── state.js │ │ │ │ └── actions.js │ │ │ ├── app.vue │ │ │ └── routes.js │ │ │ └── package.json │ ├── next-intl │ │ ├── .gitignore │ │ ├── next.config.js │ │ ├── .eslintrc │ │ ├── public │ │ │ └── favicon.ico │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── global.d.ts │ │ ├── src │ │ │ ├── i18n.ts │ │ │ ├── app │ │ │ │ └── [locale] │ │ │ │ │ ├── UseTranslationsTest2.tsx │ │ │ │ │ ├── UseTranslationsTest1.tsx │ │ │ │ │ ├── GetTranslationsTest1.tsx │ │ │ │ │ ├── GetTranslationsTest2.tsx │ │ │ │ │ └── GetTranslationsTest3.tsx │ │ │ └── middleware.tsx │ │ ├── next-env.d.ts │ │ ├── messages │ │ │ ├── en.json │ │ │ └── de.json │ │ └── package.json │ ├── ngneat-transloco │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── i18n │ │ │ ├── en.json │ │ │ └── es.json │ │ └── app │ │ │ └── home.component.html │ ├── i18n-js │ │ ├── src │ │ │ ├── locales │ │ │ │ ├── en.json │ │ │ │ ├── sk.json │ │ │ │ └── index.js │ │ │ ├── setupTests.js │ │ │ ├── App.test.js │ │ │ ├── index.css │ │ │ ├── reportWebVitals.js │ │ │ └── App.js │ │ ├── public │ │ │ ├── robots.txt │ │ │ ├── favicon.ico │ │ │ ├── logo192.png │ │ │ └── logo512.png │ │ ├── .vscode │ │ │ └── settings.json │ │ └── .gitignore │ ├── laravel │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── resources │ │ │ └── lang │ │ │ │ ├── es-es │ │ │ │ └── messages.php │ │ │ │ └── en │ │ │ │ ├── messages.php │ │ │ │ └── validation.php │ │ └── app │ │ │ └── User.php │ ├── ruby-on-rails │ │ ├── .vscode │ │ │ └── settings.json │ │ └── app │ │ │ └── views │ │ │ └── pages │ │ │ └── index.html.erb │ ├── next-international │ │ ├── .gitignore │ │ ├── next.config.js │ │ ├── public │ │ │ └── favicon.ico │ │ ├── src │ │ │ ├── locales │ │ │ │ ├── en.ts │ │ │ │ ├── fr.ts │ │ │ │ └── index.ts │ │ │ └── pages │ │ │ │ └── _app.tsx │ │ ├── next-env.d.ts │ │ └── .vscode │ │ │ └── settings.json │ ├── lingui-nextjs │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── .babelrc │ │ ├── public │ │ │ └── favicon.ico │ │ ├── pages │ │ │ └── api │ │ │ │ └── hello.ts │ │ ├── lingui.config.js │ │ ├── lingui-example │ │ │ ├── styles.css │ │ │ └── components │ │ │ │ └── PluralExample.tsx │ │ └── next.config.js │ ├── angular │ │ └── src │ │ │ ├── environments │ │ │ └── environment.prod.ts │ │ │ ├── styles.css │ │ │ ├── tsconfig.app.json │ │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.module.ts │ │ │ └── app.component.html │ │ │ ├── tsconfig.spec.json │ │ │ ├── index.html │ │ │ ├── tslint.json │ │ │ └── main.ts │ ├── php-po │ │ ├── locale │ │ │ ├── zh-CN │ │ │ │ └── messages.po │ │ │ └── en_US │ │ │ │ └── messages.po │ │ ├── .vscode │ │ │ └── settings.json │ │ └── index.php │ ├── fluent-vue │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── src │ │ │ ├── index.js │ │ │ └── fluent.js │ │ ├── package.json │ │ └── i18n │ │ │ └── en.ftl │ ├── svelte │ │ ├── .vscode │ │ │ └── settings.json │ │ └── src │ │ │ ├── routes │ │ │ └── about │ │ │ │ └── _locales │ │ │ │ ├── ar.json │ │ │ │ ├── en.json │ │ │ │ ├── pt-BR.json │ │ │ │ ├── default.json │ │ │ │ └── es-ES.json │ │ │ └── i18n.js │ ├── chrome-extension │ │ ├── popup.js │ │ └── _locales │ │ │ ├── ja │ │ │ └── messages.json │ │ │ └── en │ │ │ └── messages.json │ ├── ngx-translate │ │ ├── src │ │ │ ├── i18n │ │ │ │ ├── en.json │ │ │ │ └── fr.json │ │ │ ├── should_ignore.jsx │ │ │ └── should_ignore.vue │ │ ├── .vscode │ │ │ └── settings.json │ │ └── tsconfig.json │ └── vue-i18n │ │ ├── package.json │ │ ├── locales │ │ ├── zh-cn.json │ │ └── ja.json │ │ └── .vscode │ │ └── settings.json └── README.md ├── test ├── fixtures │ ├── js │ │ ├── basic │ │ │ └── simple │ │ │ │ ├── input │ │ │ │ ├── messages.en.json │ │ │ │ └── source.js │ │ │ │ └── output │ │ │ │ ├── messages.en.json │ │ │ │ └── source.js │ │ └── .vscode │ │ │ └── settings.json │ └── vue │ │ ├── interpolation │ │ ├── simple_attribute │ │ │ ├── input │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ │ └── output │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ ├── simple_inline_text │ │ │ ├── input │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ │ └── output │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ ├── reuse_keys │ │ │ ├── input │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ │ └── output │ │ │ │ ├── messages.en.json │ │ │ │ └── source.vue │ │ └── key_conflict_auto_increment │ │ │ ├── input │ │ │ ├── source.vue │ │ │ └── messages.en.json │ │ │ └── output │ │ │ ├── source.vue │ │ │ └── messages.en.json │ │ ├── scripts │ │ ├── v2-cjs.js │ │ └── v2-esm.js │ │ └── .vscode │ │ └── settings.json ├── e2e │ ├── frameworks │ │ ├── laravel │ │ │ └── index.ts │ │ ├── svelte │ │ │ └── index.ts │ │ ├── vue-i18n │ │ │ └── index.ts │ │ ├── react-i18next │ │ │ └── index.ts │ │ ├── ruby-on-rails │ │ │ └── index.ts │ │ ├── vue-i18n-sfc │ │ │ └── index.ts │ │ └── i18next-shopify │ │ │ └── index.ts │ └── tsconfig.json ├── unit │ ├── tsconfig.json │ └── setup.ts ├── README.md └── fixture-scripts │ └── tsconfig.json ├── res ├── logo.png ├── flags │ ├── id.svg │ ├── jm.svg │ ├── lv.svg │ ├── bd.svg │ ├── ng.svg │ ├── ja.svg │ ├── jp.svg │ ├── mc.svg │ ├── at.svg │ ├── pw.svg │ ├── ua.svg │ ├── uk.svg │ ├── gl.svg │ ├── pl.svg │ ├── cr.svg │ ├── ee.svg │ ├── bq.svg │ ├── fr.svg │ ├── hu.svg │ ├── nl.svg │ ├── ye.svg │ ├── be.svg │ ├── bh.svg │ ├── bw.svg │ ├── co.svg │ ├── lt.svg │ ├── bg.svg │ ├── bj.svg │ ├── it.svg │ ├── ru.svg │ ├── ci.svg │ ├── cz.svg │ ├── gn.svg │ ├── gp.svg │ ├── mf.svg │ ├── mg.svg │ ├── pm.svg │ ├── re.svg │ ├── sl.svg │ ├── yt.svg │ ├── ga.svg │ ├── gr.svg │ ├── ml.svg │ ├── se.svg │ ├── td.svg │ ├── am.svg │ ├── bs.svg │ ├── dk.svg │ ├── gb-eng.svg │ ├── la.svg │ ├── eo.svg │ ├── ps.svg │ ├── lu.svg │ ├── th.svg │ ├── ch.svg │ ├── fi.svg │ ├── ro.svg │ ├── sd.svg │ ├── es-ca.svg │ ├── is.svg │ ├── mu.svg │ ├── tt.svg │ ├── cg.svg │ ├── kw.svg │ ├── qa.svg │ ├── ae.svg │ ├── ne.svg │ ├── to.svg │ ├── tz.svg │ ├── dz.svg │ ├── gm.svg │ ├── mv.svg │ ├── sc.svg │ ├── lc.svg │ ├── gh.svg │ ├── de.svg │ ├── es-eu.svg │ ├── cu.svg │ ├── gb-sct.svg │ ├── fo.svg │ ├── sr.svg │ ├── aw.svg │ ├── gy.svg │ ├── wf.svg │ ├── bv.svg │ ├── no.svg │ ├── sj.svg │ ├── tr.svg │ ├── ax.svg │ ├── vc.svg │ ├── mk.svg │ ├── cd.svg │ ├── tn.svg │ ├── cf.svg │ ├── ly.svg │ ├── ss.svg │ ├── gg.svg │ ├── ba.svg │ ├── gb.svg │ ├── sh.svg │ ├── dj.svg │ ├── gb-nir.svg │ ├── pk.svg │ └── tw.svg ├── dark │ ├── plus.svg │ ├── collection.svg │ ├── checkmark.svg │ ├── help-star.svg │ ├── help-heart.svg │ ├── review-conflict.svg │ ├── warning.svg │ ├── review-request-change.svg │ ├── review-comment.svg │ ├── review-suggestions.svg │ ├── empty.svg │ └── help-report-issue.svg └── light │ ├── collection.svg │ ├── checkmark.svg │ ├── help-star.svg │ ├── help-heart.svg │ └── help-report-issue.svg ├── screenshots ├── hover.png ├── manage.png ├── extract.png ├── missing.png ├── overview.png ├── problems.png ├── annotation.png ├── full-logo.png ├── full-logo-new.png ├── lokalise-logo.png ├── migration.v1.png ├── missing_keys.png ├── yaml_support.png ├── frameworks │ ├── ember.png │ ├── rails.png │ ├── react.png │ ├── vue.png │ ├── angular.png │ ├── chrome.png │ ├── flutter.png │ ├── i18next.png │ ├── i18ntag.png │ ├── joomla.png │ ├── laravel.png │ ├── vscode.png │ └── README.md ├── overview-zh-cn.png ├── progress_report.png ├── locale-annotation.png └── refactor_translate.png ├── src ├── webview │ └── src │ │ ├── api.js │ │ └── index.html ├── extraction │ ├── index.ts │ ├── parsers │ │ ├── index.ts │ │ └── utils.ts │ └── rules │ │ ├── base.ts │ │ ├── dynamic.ts │ │ └── index.ts ├── utils │ ├── keypathValidate.ts │ ├── index.ts │ └── cache.ts ├── views │ ├── items │ │ ├── Seperator.ts │ │ ├── ProgressTranslatedListItem.ts │ │ └── index.ts │ ├── providers │ │ └── index.ts │ └── ViewIds.ts ├── modules.ts ├── packagesParsers │ ├── index.ts │ ├── gemfile.ts │ ├── composerJSON.ts │ ├── pubspecYAML.ts │ └── packageJSON.ts ├── env.ts ├── links.ts ├── translators │ └── engines │ │ └── google-cn.ts ├── commands │ ├── manipulations │ │ ├── copyKey.ts │ │ ├── markKeyInUse.ts │ │ ├── index.ts │ │ └── replaceText.ts │ └── refreshUsageReport.ts ├── tagSystems │ ├── none.ts │ └── index.ts ├── parsers │ ├── ini.ts │ └── properties.ts └── core │ └── index.ts ├── .vscode ├── i18n-ally-reviews.yml └── extensions.json ├── tsconfig.commonjs.json ├── .eslintrc.js ├── scripts ├── post-build.ts └── build-flags.ts ├── .eslintignore ├── CODEOWNERS ├── .tazerc.json ├── .gitignore ├── .editorconfig ├── assets ├── loader.js └── editor │ └── index.html └── .github └── renovate.json5 /.mocharc.yml: -------------------------------------------------------------------------------- 1 | timeout: 30000 2 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | ignore-engines true 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/he.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/es.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/by-features/extractions/.eslintignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/de.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/de-de.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/zh-cn.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/zh-hk.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/zh-sg.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/zh-tw.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/by-features/yaml/locales/zh-cn.yml: -------------------------------------------------------------------------------- 1 | hello: 你好 2 | -------------------------------------------------------------------------------- /examples/by-features/collections/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /examples/by-frameworks/non-i18n-project/locales/ja.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/non-i18n-project/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/app.js: -------------------------------------------------------------------------------- 1 | i18n.t('hello') 2 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/de-DE-bavarian.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/js/basic/simple/input/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/locales/en.yml: -------------------------------------------------------------------------------- 1 | hello: Hello 2 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/en.yml: -------------------------------------------------------------------------------- 1 | foo: Foo 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/index.ts: -------------------------------------------------------------------------------- 1 | const a = customT('nested.foo.bar') 2 | -------------------------------------------------------------------------------- /res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/res/logo.png -------------------------------------------------------------------------------- /examples/by-frameworks/ember/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "你好" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue-sfc/i18n/en.ftl: -------------------------------------------------------------------------------- 1 | global-key = Global value 2 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_attribute/input/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/en/general.yml: -------------------------------------------------------------------------------- 1 | hello: Hello 2 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/general/en.yml: -------------------------------------------------------------------------------- 1 | hello: Hello 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/non-i18n-project/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "Hello" 3 | } -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"{{appTitle}}" 3 | } -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_inline_text/input/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/en/a.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | a: 'A', 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/en/b.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | b: 'B', 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleA/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "one": "Un" 3 | } -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleA/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "one": "一" 3 | } -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleB/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "two": "Deux" 3 | } -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleB/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "two": "二" 3 | } -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/fr/general.yml: -------------------------------------------------------------------------------- 1 | hello: Bonjour 2 | -------------------------------------------------------------------------------- /test/fixtures/js/basic/simple/output/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": "Welcome" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/ca.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Adéu 3 | hello: Hola 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/ja.yml: -------------------------------------------------------------------------------- 1 | color: 色 2 | goodbye: さようなら 3 | hello: こんにちは 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/ko.yml: -------------------------------------------------------------------------------- 1 | color: 색깔 2 | goodbye: 안녕 3 | hello: 안녕하세요 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/zh-cn.yml: -------------------------------------------------------------------------------- 1 | color: 颜色 2 | goodbye: 再见 3 | hello: 你好 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/zh-hk.yml: -------------------------------------------------------------------------------- 1 | color: 顏色 2 | goodbye: 再見 3 | hello: 你好 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/zh-sg.yml: -------------------------------------------------------------------------------- 1 | color: 颜色 2 | goodbye: 再见 3 | hello: 你好 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/zh-tw.yml: -------------------------------------------------------------------------------- 1 | color: 顏色 2 | goodbye: 再見 3 | hello: 你好 4 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/zh-cn/a.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | a: '甲', 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/zh-cn/b.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | b: '乙', 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleA/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "one": "One" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleB/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "two": "Two" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/general/fr.yml: -------------------------------------------------------------------------------- 1 | hello: Bonjour 2 | 3 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "global-hello": "グローバルハローワールド" 3 | } -------------------------------------------------------------------------------- /screenshots/hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/hover.png -------------------------------------------------------------------------------- /screenshots/manage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/manage.png -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/af.yml: -------------------------------------------------------------------------------- 1 | color: Kleur 2 | goodbye: totsiens 3 | hello: hallo 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/am.yml: -------------------------------------------------------------------------------- 1 | color: ቀለም 2 | goodbye: ደህና ሁን 3 | hello: ጤና ይስጥልኝ 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/cy.yml: -------------------------------------------------------------------------------- 1 | color: Lliw 2 | goodbye: Hwyl fawr 3 | hello: Helo 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/es-ar.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Adiós 3 | hello: Hola 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/et.yml: -------------------------------------------------------------------------------- 1 | color: Värv 2 | goodbye: Hüvasti 3 | hello: Tere! 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/hr.yml: -------------------------------------------------------------------------------- 1 | color: Boja 2 | goodbye: Doviđenja 3 | hello: Bok 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/mk.yml: -------------------------------------------------------------------------------- 1 | color: Боја 2 | goodbye: Збогум 3 | hello: Здраво 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/mt.yml: -------------------------------------------------------------------------------- 1 | color: Kulur 2 | goodbye: Goodbye 3 | hello: Hello 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/ne.yml: -------------------------------------------------------------------------------- 1 | color: रंग 2 | goodbye: अलविदा 3 | hello: नमस्कार 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/pt-br.yml: -------------------------------------------------------------------------------- 1 | color: Cor 2 | goodbye: Adeus 3 | hello: Olá 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/ru.yml: -------------------------------------------------------------------------------- 1 | color: цвет 2 | goodbye: Прощай 3 | hello: привет 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/th.yml: -------------------------------------------------------------------------------- 1 | color: สี 2 | goodbye: ลาก่อน 3 | hello: สวัสดี 4 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/en/a.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "Yes", 3 | "no": "no" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/en/b.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "YesB", 3 | "no": "NoB" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/ja/a.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "Yes", 3 | "no": "no" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/ja/b.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "YesB", 3 | "no": "NoB" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/zh-cn/a.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "Yes", 3 | "no": "no" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleC/nested/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "three": "Trois" 3 | } -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleC/nested/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "three": "三" 3 | } -------------------------------------------------------------------------------- /screenshots/extract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/extract.png -------------------------------------------------------------------------------- /screenshots/missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/missing.png -------------------------------------------------------------------------------- /screenshots/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/overview.png -------------------------------------------------------------------------------- /screenshots/problems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/problems.png -------------------------------------------------------------------------------- /src/webview/src/api.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | export const vscode = acquireVsCodeApi() 3 | -------------------------------------------------------------------------------- /test/fixtures/js/basic/simple/input/source.js: -------------------------------------------------------------------------------- 1 | const bar = 456; 2 | 3 | const result = 'Welcome'; 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/reuse_keys/input/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "Foobar" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/aq.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Goodbye 3 | hello: Hi there 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/be.yml: -------------------------------------------------------------------------------- 1 | color: Колер 2 | goodbye: Бывай 3 | hello: Прывітанне 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/en-ca.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Goodbye 3 | hello: Hi there 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/en-uk.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Goodbye 3 | hello: Hi there 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/gd.yml: -------------------------------------------------------------------------------- 1 | color: Dath 2 | goodbye: Mar sin leat 3 | hello: Halò 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/no-no.yml: -------------------------------------------------------------------------------- 1 | color: Farge 2 | goodbye: Ha det 3 | hello: Hallo 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/vi.yml: -------------------------------------------------------------------------------- 1 | color: Màu sắc 2 | goodbye: Tạm biệt 3 | hello: Xin chào 4 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/public/locales/en/pages/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Home" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/zh-cn/b.json: -------------------------------------------------------------------------------- 1 | { 2 | "yes": "YesB", 3 | "no": "NoB" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/module-style/modules/moduleC/nested/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "three": "Three" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/en/foo/bar.yml: -------------------------------------------------------------------------------- 1 | apple: Apple 2 | orange: Orange 3 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/fr/foo/bar.yml: -------------------------------------------------------------------------------- 1 | apple: Pomme 2 | orange: Orange 3 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/foo/bar/en.yml: -------------------------------------------------------------------------------- 1 | apple: Apple 2 | orange: Orange 3 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/foo/bar/fr.yml: -------------------------------------------------------------------------------- 1 | apple: Pomme 2 | orange: Orange 3 | -------------------------------------------------------------------------------- /examples/by-features/yaml/locales/ja.yaml: -------------------------------------------------------------------------------- 1 | hello: こんにちは 2 | nested: 3 | hello: また会いましたね 4 | yeah: Good 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/flutter/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "assets/i18n" 3 | } -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/public/locales/en/pages/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Home" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/jekyll/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": ["_i18n"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales" 3 | } -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/public/locales/de/pages/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Zuhause" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/public/locales/en/pages/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Home" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "global-hello": "Global Hello World" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/vuex-i18n/todo-demo/app/store/state.js: -------------------------------------------------------------------------------- 1 | export default { 2 | todos: [], 3 | } 4 | -------------------------------------------------------------------------------- /screenshots/annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/annotation.png -------------------------------------------------------------------------------- /screenshots/full-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/full-logo.png -------------------------------------------------------------------------------- /test/fixtures/js/basic/simple/output/source.js: -------------------------------------------------------------------------------- 1 | const bar = 456; 2 | 3 | const result = $t('welcome'); 4 | -------------------------------------------------------------------------------- /.vscode/i18n-ally-reviews.yml: -------------------------------------------------------------------------------- 1 | # Review comments generated by i18n-ally. Please commit this file. 2 | 3 | {} 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/de.yml: -------------------------------------------------------------------------------- 1 | color: Farbe 2 | goodbye: Auf Wiedersehen 3 | hello: Hallo 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/fr-fr.yml: -------------------------------------------------------------------------------- 1 | color: Couleur 2 | goodbye: Au revoir 3 | hello: Bonjour 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/mn.yml: -------------------------------------------------------------------------------- 1 | color: Өнгө 2 | goodbye: Баяртай 3 | hello: Сайн байцгаана уу 4 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "i18next": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/flatten-scope-conflict/lang/ja.yml: -------------------------------------------------------------------------------- 1 | FOO: FOO 2 | FOO.BAR: 'BAR' 3 | FOO.BAR.FOO: FOOBAR 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/en/foo.yml: -------------------------------------------------------------------------------- 1 | animals: 2 | cat: Cat 3 | dog: Dog 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/i18n/fr/foo.yml: -------------------------------------------------------------------------------- 1 | animals: 2 | cat: Chat 3 | dog: Chien 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/foo/en.yml: -------------------------------------------------------------------------------- 1 | animals: 2 | cat: Cat 3 | dog: Dog 4 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/i18n/foo/fr.yml: -------------------------------------------------------------------------------- 1 | animals: 2 | cat: Chat 3 | dog: Chien 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/ember/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "ember-intl": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/public/locales/de/pages/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Zuhause" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.next/ 3 | .DS_Store 4 | tsconfig.tsbuildinfo 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/en/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "next-translate library" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/es/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Librería next-translate" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngneat-transloco/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "i18n" 3 | } 4 | -------------------------------------------------------------------------------- /screenshots/full-logo-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/full-logo-new.png -------------------------------------------------------------------------------- /screenshots/lokalise-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/lokalise-logo.png -------------------------------------------------------------------------------- /screenshots/migration.v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/migration.v1.png -------------------------------------------------------------------------------- /screenshots/missing_keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/missing_keys.png -------------------------------------------------------------------------------- /screenshots/yaml_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/yaml_support.png -------------------------------------------------------------------------------- /examples/by-features/js-parser/locales/ja.js: -------------------------------------------------------------------------------- 1 | // commonjs export 2 | module.exports = { 3 | hello: 'こんにちは', 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "i18next": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "home": { 3 | "headline": "Welcome" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/locales/sk.json: -------------------------------------------------------------------------------- 1 | { 2 | "home": { 3 | "headline": "Vitajte" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/laravel/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "resources/lang", 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/ca/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Llibreria next-translate" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/ruby-on-rails/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "config/locales" 3 | } -------------------------------------------------------------------------------- /screenshots/frameworks/ember.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/ember.png -------------------------------------------------------------------------------- /screenshots/frameworks/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/rails.png -------------------------------------------------------------------------------- /screenshots/frameworks/react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/react.png -------------------------------------------------------------------------------- /screenshots/frameworks/vue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/vue.png -------------------------------------------------------------------------------- /screenshots/overview-zh-cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/overview-zh-cn.png -------------------------------------------------------------------------------- /screenshots/progress_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/progress_report.png -------------------------------------------------------------------------------- /examples/by-features/collections/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": [ 3 | "locales" 4 | ] 5 | } -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.next/ 3 | .DS_Store 4 | tsconfig.tsbuildinfo 5 | -------------------------------------------------------------------------------- /screenshots/frameworks/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/angular.png -------------------------------------------------------------------------------- /screenshots/frameworks/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/chrome.png -------------------------------------------------------------------------------- /screenshots/frameworks/flutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/flutter.png -------------------------------------------------------------------------------- /screenshots/frameworks/i18next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/i18next.png -------------------------------------------------------------------------------- /screenshots/frameworks/i18ntag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/i18ntag.png -------------------------------------------------------------------------------- /screenshots/frameworks/joomla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/joomla.png -------------------------------------------------------------------------------- /screenshots/frameworks/laravel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/laravel.png -------------------------------------------------------------------------------- /screenshots/frameworks/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/frameworks/vscode.png -------------------------------------------------------------------------------- /screenshots/locale-annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/locale-annotation.png -------------------------------------------------------------------------------- /screenshots/refactor_translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/screenshots/refactor_translate.png -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_attribute/output/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome-bar": "Welcome, {0}" 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_inline_text/output/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome-bar": "Welcome, {0}" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-features/flatten-scope-conflict/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "vue-i18n": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "custom", 3 | "version": "0.1.0", 4 | "private": true 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": [ 3 | "locale" 4 | ] 5 | } -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/README.md: -------------------------------------------------------------------------------- 1 | Ported from https://github.com/lingui/js-lingui/tree/main/examples/next-js 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/i18n/i18n_ar.properties: -------------------------------------------------------------------------------- 1 | hello = مرحبًا بالتطبيق! 2 | steady = انقر فوق لي!! 3 | title = تطبيقي -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app', 4 | ], 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/key_conflict_auto_increment/input/source.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/reuse_keys/output/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "Foobar", 3 | "barfoo": "Barfoo" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/flatten-scope-conflict/index.js: -------------------------------------------------------------------------------- 1 | const $t = '' 2 | 3 | $t('FOO') 4 | $t('FOO.BAR') 5 | $t('FOO.BAR.FOO') 6 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "vue-i18n": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "vue-i18n": "*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": [ 3 | "src/locales" 4 | ] 5 | } -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.commonjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | } 6 | } -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/src/customScopeRange.js: -------------------------------------------------------------------------------- 1 | export { useTranslation as customScopeRangeFn } from 'react-i18next' 2 | -------------------------------------------------------------------------------- /examples/by-frameworks/ember/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "Hello", 3 | "some.key": "Foo", 4 | "some.other.key": "Bar" 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "next/babel" 4 | ], 5 | "plugins": ["macros"] 6 | } 7 | -------------------------------------------------------------------------------- /test/e2e/frameworks/laravel/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/e2e/frameworks/svelte/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/e2e/frameworks/vue-i18n/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/key_conflict_auto_increment/input/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "Bar", 3 | "foo-0": "Bar0" 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/reuse_keys/input/source.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/en/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | A: require('./a.json'), 3 | B: require('./b.json'), 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/ja/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | A: require('./a.json'), 3 | B: require('./b.json'), 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/locales/zh-cn/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | A: require('./a.json'), 3 | B: require('./b.json'), 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/ko.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-features/encoding/locales/ko.yml -------------------------------------------------------------------------------- /examples/by-features/extractions/a.tsx: -------------------------------------------------------------------------------- 1 | const world = 'World' 2 | const a = `Hello ${world}` 3 | 4 | const foo =
5 | -------------------------------------------------------------------------------- /examples/by-features/flatten-scope-conflict/lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "FOO": "foo", 3 | "FOO.BAR": "bar", 4 | "FOO.BAR.FOO": "foobar" 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/locales/zh_cn.js: -------------------------------------------------------------------------------- 1 | // export as async function 2 | export default async () => ({ 3 | hello: '你好', 4 | }) 5 | -------------------------------------------------------------------------------- /examples/by-features/yaml/locales/en.yml: -------------------------------------------------------------------------------- 1 | hello: Hello 2 | project: YAML 3 | nested: 4 | hello: Hello again 5 | foo: 6 | bar: foobar 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/jekyll/_i18n/en.yml: -------------------------------------------------------------------------------- 1 | four_hundred_four: 2 | page_not_found: Page not found :( 3 | turn_back_home: Go back home 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/next.config.js: -------------------------------------------------------------------------------- 1 | const withNextIntl = require('next-intl/plugin')() 2 | 3 | module.exports = withNextIntl() 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/php-po/locale/zh-CN/messages.po: -------------------------------------------------------------------------------- 1 | msgid "hello-world" 2 | msgstr "你好世界" 3 | 4 | msgid "good-morning" 5 | msgstr "早上好" 6 | -------------------------------------------------------------------------------- /test/e2e/frameworks/react-i18next/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/e2e/frameworks/ruby-on-rails/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/e2e/frameworks/vue-i18n-sfc/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/key_conflict_auto_increment/output/source.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/de.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-features/encoding/locales/de.json -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/fr.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-features/encoding/locales/fr.json -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/ja.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-features/encoding/locales/ja.json -------------------------------------------------------------------------------- /examples/by-features/linked/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "デモ", 3 | "intro": "より良い翻訳体験をもたらします", 4 | "good_morning": "おはようございます" 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.sourceLanguage": "en" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/ember/template.hbs: -------------------------------------------------------------------------------- 1 | {{t 'hello'}} 2 | 3 | {{t "some.key" 4 | htmlSafe=true 5 | property=(t "some.other.key") 6 | }} 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue-sfc/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "i18n", 3 | "i18n-ally.keystyle": "nested" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "i18n", 3 | "i18n-ally.keystyle": "nested" 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "import/named": "off", 4 | "react/react-in-jsx-scope": "off" 5 | } 6 | } -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/en/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "example-of-dynamic-translation": "I'm a dynamic loaded content" 3 | } 4 | -------------------------------------------------------------------------------- /src/extraction/index.ts: -------------------------------------------------------------------------------- 1 | export * from './shouldExtract' 2 | export * from './rules' 3 | export * from './parsers' 4 | export * from './utils' 5 | -------------------------------------------------------------------------------- /src/utils/keypathValidate.ts: -------------------------------------------------------------------------------- 1 | export function keypathValidate(keypath: string) { 2 | return !!keypath.match(/^[\w\d\-_][\w\d\-_[\]. ]*$/) 3 | } 4 | -------------------------------------------------------------------------------- /test/e2e/frameworks/i18next-shopify/index.ts: -------------------------------------------------------------------------------- 1 | import { createRunner } from '../../runner' 2 | 3 | export const run = createRunner(__dirname) 4 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_inline_text/input/source.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/locales/fr.ts: -------------------------------------------------------------------------------- 1 | // export as function 2 | export default (): object => ({ 3 | hello: 'Bonjour!'.toUpperCase(), 4 | }) 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/flutter/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-frameworks/i18n-js/public/favicon.ico -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-frameworks/i18n-js/public/logo192.png -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-frameworks/i18n-js/public/logo512.png -------------------------------------------------------------------------------- /examples/by-frameworks/jekyll/_i18n/fr.yml: -------------------------------------------------------------------------------- 1 | four_hundred_four: 2 | page_not_found: Page non trouvée :( 3 | turn_back_home: Retourner à l'accueil 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/laravel/resources/lang/es-es/messages.php: -------------------------------------------------------------------------------- 1 | 'Me encanta programar.' 5 | ]; 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/i18n/i18n_en.properties: -------------------------------------------------------------------------------- 1 | steady = Click me!! 2 | hello = Hello App! 3 | title = My App 4 | appTitle = Test Application -------------------------------------------------------------------------------- /examples/by-features/flatten-mode/lang/ja.yml: -------------------------------------------------------------------------------- 1 | nested.hello: また会いましたね 2 | nested.greeting: おはようございます 3 | project: 基本 4 | tos: 利用規約 5 | term: "{0}を受け入れます" 6 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/en/index.ts: -------------------------------------------------------------------------------- 1 | import a from './a' 2 | import b from './b' 3 | 4 | export default { 5 | ...a, 6 | ...b, 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-frameworks/next-intl/public/favicon.ico -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/ca/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "example-of-dynamic-translation": "Sóc contingut carregat de forma dinàmica" 3 | } 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/es/dynamic.json: -------------------------------------------------------------------------------- 1 | { 2 | "example-of-dynamic-translation": "Soy contenido cargado de forma dinámica" 3 | } 4 | -------------------------------------------------------------------------------- /src/views/items/Seperator.ts: -------------------------------------------------------------------------------- 1 | import { BaseTreeItem } from './Base' 2 | 3 | export class Seperator extends BaseTreeItem { 4 | description = '——' 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_attribute/input/source.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/locales/zh-cn/index.ts: -------------------------------------------------------------------------------- 1 | import a from './a' 2 | import b from './b' 3 | 4 | export default { 5 | ...a, 6 | ...b, 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/jekyll/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'jekyll', github: 'jekyll/jekyll' 4 | gem 'jekyll-multiple-languages-plugin' 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "messages", 3 | "i18n-ally.enabledFrameworks": ["next-intl"] 4 | } 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/php-po/locale/en_US/messages.po: -------------------------------------------------------------------------------- 1 | msgid "hello-world" 2 | msgstr "Hello, world" 3 | 4 | msgid "good-morning" 5 | msgstr "Good morning" 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": [ 3 | "messages", 4 | "src/routes/about/_locales" 5 | ], 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/key_conflict_auto_increment/output/messages.en.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "Bar", 3 | "foo-0": "Bar0", 4 | "foo-1": "Foo" 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/reuse_keys/output/source.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_attribute/output/source.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /test/fixtures/vue/interpolation/simple_inline_text/output/source.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /examples/by-features/demo/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "", 3 | "intro": "より良い翻訳体験をもたらしま", 4 | "good_morning": "おはようございます", 5 | "hello": "こんにちは!" 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokalise/i18n-ally/HEAD/examples/by-frameworks/lingui-nextjs/public/favicon.ico -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | i18n: { 3 | locales: ["en", "fr"], 4 | defaultLocale: "en" 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /examples/by-features/demo/locales/ko.yml: -------------------------------------------------------------------------------- 1 | project: 데모 2 | some: 3 | deep: 4 | nested: 5 | key: 중첩 된! 6 | intro: 더 나은 번역 경험을 제공합니다. 7 | good_morning: 좋은 아침 8 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/App.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "commonjs", 5 | "allowJs": true 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/laravel/app/User.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/extraction/parsers/index.ts: -------------------------------------------------------------------------------- 1 | import * as html from './html' 2 | import * as babel from './babel' 3 | 4 | export const extractionsParsers = { 5 | html, 6 | babel, 7 | } 8 | -------------------------------------------------------------------------------- /src/modules.ts: -------------------------------------------------------------------------------- 1 | import { ExtensionContext, Disposable } from 'vscode' 2 | 3 | export interface ExtensionModule { 4 | (ctx: ExtensionContext): Disposable | Disposable[] 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.fileNamespace": true, 4 | "i18n-ally.keystyle": "nested", 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/linked/locales/ko.yml: -------------------------------------------------------------------------------- 1 | project: 데모 2 | some: 3 | deep: 4 | nested: 5 | key: 중첩 된! 6 | intro: 더 나은 번역 경험을 제공합니다. 7 | good_morning: 좋은 아침 8 | hello: '' 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/en/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "This text is wrote in English from the homepage dictionary", 3 | "more-examples": "More examples" 4 | } -------------------------------------------------------------------------------- /examples/by-frameworks/ngx-translate/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "HOME": { 3 | "TITLE": "Bonjour Angular avec ngx-translate !", 4 | "SELECT": "Changer la langue" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /res/flags/jm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/lv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/packagesParsers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './base' 2 | export * from './packageJSON' 3 | export * from './pubspecYAML' 4 | export * from './composerJSON' 5 | export * from './gemfile' 6 | -------------------------------------------------------------------------------- /examples/by-features/flatten-mode/lang/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "基本", 3 | "tos": "服务期限", 4 | "term": "我接受{0}", 5 | "nested.hello": "再次问好", 6 | "nested.greeting": "早上好" 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngx-translate/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "src/i18n", 3 | "i18n-ally.dirStructure": "file", 4 | "i18n-ally.keystyle": "nested" 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.keystyle": "nested", 3 | "i18n-ally.sourceLanguage": "en", 4 | "i18n-ally.localesPaths": "locales", 5 | } 6 | -------------------------------------------------------------------------------- /res/dark/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/bd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/ng.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /scripts/post-build.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs-extra' 2 | 3 | async function run() { 4 | await fs.writeFile('dist/extension.d.ts', 'export * from \'./src/extension\'') 5 | } 6 | 7 | run() 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/laravel/resources/lang/en/messages.php: -------------------------------------------------------------------------------- 1 | 'Welcome to our application', 5 | 'I love programming' => 'I love programming.' 6 | ]; 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngx-translate/src/should_ignore.jsx: -------------------------------------------------------------------------------- 1 | const translate = {} 2 | 3 | translate.get('HOME.TITLE', { value: 'world' }) 4 | translate.get(['HOME.TITLE'], { value: 'world' }) 5 | -------------------------------------------------------------------------------- /res/flags/ja.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/jp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/mc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/ca/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Aquest text està escrit en Català desde el diccionari de la pàgina d'inici", 3 | "more-examples": "Més exemples" 4 | } -------------------------------------------------------------------------------- /res/flags/at.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/pw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/by-features/custom-locales-path/lang/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "基本", 3 | "tos": "服务期限", 4 | "term": "我接受{0}", 5 | "nested": { 6 | "hello": "再次问好", 7 | "greeting": "早上好" 8 | } 9 | } -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.enabledParsers": ["ts", "js"], 4 | "i18n-ally.ignoreFiles": ["**/index.ts"] 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/chrome-extension/_locales/ja/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "errorRemoved": { 3 | "message": "削除しました" 4 | }, 5 | "showInFolderTitle": { 6 | "message": "フォルダで見て" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/global.d.ts: -------------------------------------------------------------------------------- 1 | // Use type safe message keys with `next-intl` 2 | type Messages = typeof import('./messages/en.json') 3 | declare interface IntlMessages extends Messages {} 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/locales/es/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Este texto está escrito en Español desde el diccionario de la página de inicio", 3 | "more-examples": "Más ejemplos" 4 | } -------------------------------------------------------------------------------- /examples/by-features/json5/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": [ 3 | "locales" 4 | ], 5 | "i18n-ally.parsers.extendFileExtensions": { 6 | "my-custom-ext": "json5" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /res/flags/ua.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/uk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | out/ 2 | dist/ 3 | examples/ 4 | .cache/ 5 | res/ 6 | test-resources/ 7 | test/e2e-out/ 8 | test/e2e-fixtures-temp/ 9 | test/fixture-scripts-out/ 10 | test/fixtures/ 11 | test/fixtures-temp/ 12 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/en-us.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Demo", 3 | "some": { 4 | "deep": { 5 | "nested": { 6 | "encoding": "UTF-8 BOM" 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-features/linked/locales/nl-nl.ini: -------------------------------------------------------------------------------- 1 | hello=Hi 2 | good_morning=Goedemorgen 3 | hi= 4 | intro= 5 | linked= 6 | project= 7 | yad= 8 | 9 | [some.deep.nested] 10 | key= 11 | 12 | [yes.no] 13 | and= 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngneat-transloco/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "Hello", 3 | "params": "Hello {{value}} english", 4 | "some": { 5 | "nested": { 6 | "key": "nested key english" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /res/flags/gl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/pl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/by-features/demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/encoding/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/locales/en.ts: -------------------------------------------------------------------------------- 1 | // module export 2 | 3 | export default { 4 | project: 'Basic', 5 | hello: 'Hello', 6 | today: new Date().toDateString(), 7 | now: new Date().toTimeString(), 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-features/json5/locales/zh-cn.json5: -------------------------------------------------------------------------------- 1 | { 2 | nested: { 3 | greeting: '早上好', 4 | hello: '再次问好', 5 | }, 6 | project: '基本', 7 | term: '我接受{0}', 8 | tos: '服务期限', 9 | yeah: '是啊', 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-features/json5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/linked/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/App.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /examples/by-features/yaml/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yaml", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/src/locales/en.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | hello: "Hello", 3 | "hello.world": "Hello world!", 4 | welcome: "Hello {name}!", 5 | "child.hello": "Hello child!" 6 | } as const; 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | background-color: #222; 7 | height: 100px; 8 | padding: 20px; 9 | color: white; 10 | } 11 | -------------------------------------------------------------------------------- /res/flags/cr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/ee.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/env.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | export const isProd: boolean = process.env.NODE_ENV === 'production' 3 | export const isDev = !isProd 4 | // @ts-ignore 5 | export const isTest: boolean = process.env.NODE_ENV === 'test' 6 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | background-color: #222; 7 | height: 100px; 8 | padding: 20px; 9 | color: white; 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-features/dir-locales/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | background-color: #222; 7 | height: 100px; 8 | padding: 20px; 9 | color: white; 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /screenshots/frameworks/README.md: -------------------------------------------------------------------------------- 1 | ## Brand Logos 2 | 3 | Steps to add logos 4 | 5 | 1. Download logo from https://worldvectorlogo.com/ 6 | 2. Convert svg to png by https://svgtopng.com/ 7 | 3. Resize png with height 20px 8 | -------------------------------------------------------------------------------- /examples/by-features/collections/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "collections", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/demo/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.sourceLanguage": "en", 4 | "i18n-ally.keystyle": "nested", 5 | "i18n-ally.translate.saveAsCandidates": true, 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-features/extractions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "extractions", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/js-parser-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/src/locales/fr.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | hello: "Bonjour", 3 | "hello.world": "Bonjour Monde!", 4 | welcome: "Bonjour {name}!", 5 | "child.hello": "Bonjour enfant!" 6 | } as const; 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/pages_/_app.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import '../styles.css' 4 | 5 | export default function MyApp({ Component, pageProps }) { 6 | return 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngneat-transloco/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "Hola", 3 | "params": "Hello {{value}} spanish", 4 | "some": { 5 | "nested": { 6 | "key": "nested key spanish" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /res/flags/bq.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/fr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/hu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/nl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/ye.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/unit/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["ESNext"], 5 | "moduleResolution": "node", 6 | "esModuleInterop": true, 7 | "strict": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | *.json @terales @kibertoad @anilkk 2 | *.js @terales @kibertoad @anilkk 3 | *.ts @terales @kibertoad @anilkk 4 | *.md @terales @kibertoad @anilkk 5 | package.json @terales @kibertoad @anilkk 6 | -------------------------------------------------------------------------------- /examples/by-features/module-style/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "module-style", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/ember/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.keystyle": "nested", 4 | "i18n-ally.disablePathParsing": true, 5 | "i18n-ally.translate.fallbackToKey": true, 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/non-i18n-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "no-vue-i18n", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "vue": "^2.6.10" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/routes/about/_locales/ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "about": "About" 4 | }, 5 | "about_this_site": "عن هذا الموقع", 6 | "about_content": ["هذه هي صفحة 'حول'. ليس هناك الكثير هنا."] 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "nested": { 3 | "greeting": "早上好", 4 | "hello": "再次问好" 5 | }, 6 | "project": "基本", 7 | "term": "我接受{0}", 8 | "tos": "服务期限", 9 | "yeah": "是啊" 10 | } 11 | -------------------------------------------------------------------------------- /res/flags/be.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/bh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/bw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/co.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/lt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/links.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | github: 'https://github.com/lokalise/i18n-ally', 3 | document: 'https://github.com/lokalise/i18n-ally/blob/master/README.md', 4 | issues: 'https://github.com/lokalise/i18n-ally/issues', 5 | } 6 | -------------------------------------------------------------------------------- /examples/by-features/flatten-mode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "custom-locales-path", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/App.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/i18n.ts: -------------------------------------------------------------------------------- 1 | import { getRequestConfig } from 'next-intl/server' 2 | 3 | export default getRequestConfig(async({ locale }) => ({ 4 | messages: (await import(`../messages/${locale}.json`)).default, 5 | })) 6 | -------------------------------------------------------------------------------- /res/flags/bg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/bj.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/it.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/ru.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | 3 | export default (req, res) => { 4 | res.statusCode = 200 5 | res.json({ name: 'John Doe' }) 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/routes/about/_locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "about": "About" 4 | }, 5 | "about_this_site": "About this site", 6 | "about_content": ["This is the 'about' page. There's not much here."] 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/routes/about/_locales/pt-BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "about": "Sobre" 4 | }, 5 | "about_this_site": "Sobre este site", 6 | "about_content": ["Esta é a página 'sobre'. Não há muito aqui."] 7 | } 8 | -------------------------------------------------------------------------------- /res/flags/ci.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/cz.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/mf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/mg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/pm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/re.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/sl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/yt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/translators/engines/google-cn.ts: -------------------------------------------------------------------------------- 1 | import GoogleTranslate from './google' 2 | 3 | export default class GoogleTranslateCN extends GoogleTranslate { 4 | link = 'https://translate.google.cn' 5 | apiRoot = 'https://translate.google.cn' 6 | } 7 | -------------------------------------------------------------------------------- /src/views/providers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './CurrentFileLocalesTreeProvider' 2 | export * from './HelpFeedbackProvider' 3 | export * from './LocalesTreeProvider' 4 | export * from './ProgressProvider' 5 | export * from './UsageReportProvider' 6 | -------------------------------------------------------------------------------- /examples/by-features/custom-locales-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "custom-locales-path", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "vue": "^2.6.10", 7 | "vue-i18n": "^8.11.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/routes/about/_locales/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "about": "About" 4 | }, 5 | "about_this_site": "About this site", 6 | "about_content": ["This is the 'about' page. There's not much here."] 7 | } 8 | -------------------------------------------------------------------------------- /res/flags/ga.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/ml.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/se.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/td.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | import { fluent } from './fluent' 4 | import App from './App.vue' 5 | 6 | Vue.use(fluent) 7 | 8 | new Vue({ 9 | el: '#root', 10 | render: (h) => h(App), 11 | }) 12 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/app/[locale]/UseTranslationsTest2.tsx: -------------------------------------------------------------------------------- 1 | import { useTranslations } from 'next-intl' 2 | 3 | export default function UseTranslationsTest2() { 4 | const t = useTranslations() 5 | return

{t('Test.title')}

6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/README.md: -------------------------------------------------------------------------------- 1 | # sfc 2 | 3 | > vue-i18n custom blocks example 4 | 5 | ## Project setup 6 | ``` 7 | npm install 8 | ``` 9 | 10 | ### Compiles and hot-reloads for development 11 | ``` 12 | npm run serve 13 | ``` 14 | -------------------------------------------------------------------------------- /res/flags/am.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/bs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/dk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gb-eng.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/flags/la.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/vue/scripts/v2-cjs.js: -------------------------------------------------------------------------------- 1 | // https://github.com/vuejs/vuejs.org/blob/master/src/v2/examples/vue-20-single-file-components/Hello.vue 2 | module.exports = { 3 | data() { 4 | return { 5 | greeting: 'Hello', 6 | } 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue-sfc/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | import { fluent } from './fluent' 4 | import App from './App.vue' 5 | 6 | Vue.use(fluent) 7 | 8 | new Vue({ 9 | el: '#root', 10 | render: (h) => h(App), 11 | }) 12 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/app/[locale]/UseTranslationsTest1.tsx: -------------------------------------------------------------------------------- 1 | import { useTranslations } from 'next-intl' 2 | 3 | export default function UseTranslationsTest1() { 4 | const t = useTranslations('Test') 5 | return

{t('title')}

6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "allLanguages": ["en", "ca", "es"], 3 | "defaultLanguage": "en", 4 | "pages": { 5 | "*": ["common"], 6 | "/": ["home"], 7 | "/more-examples": ["more-examples"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/routes/about/_locales/es-ES.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "about": "Acerca de" 4 | }, 5 | "about_this_site": " Acerca de este sitio", 6 | "about_content": ["Esta es la página 'acerca de'. No hay mucho aquí."] 7 | } 8 | -------------------------------------------------------------------------------- /res/flags/eo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /res/flags/ps.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.tazerc.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | "@types/vscode", 4 | "@types/webpack", 5 | "limax", 6 | "ts-loader", 7 | "ts-node", 8 | "vue-i18n", 9 | "vue", 10 | "vuex", 11 | "webpack-cli", 12 | "webpack" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/locale-namespaces/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "i18n", 3 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.(yml|json)", 4 | "i18n-ally.namespace": true, 5 | "i18n-ally.keystyle": "nested", 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-features/path-matcher/namespaces-locale/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "i18n", 3 | "i18n-ally.pathMatcher": "{namespaces?}/?{locale}.(yml|json)", 4 | "i18n-ally.namespace": true, 5 | "i18n-ally.keystyle": "nested", 6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /res/flags/lu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/th.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/README.md: -------------------------------------------------------------------------------- 1 | # 100 Locales 2 | 3 | - There is no 100 locales, just saying. 4 | - The locales are random picked and not containing all of country/regions. 5 | - Only for testing propose, not actually working and doesn't represent anything. 6 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "��ʾ", 3 | "hello": "��ã�", 4 | "good_morning": "���Ϻ�", 5 | "some": { 6 | "deep": { 7 | "nested": { 8 | "encoding": "GB2312" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.regex.key": ".*?", 4 | "i18n-ally.sourceLanguage": "en", 5 | "i18n-ally.keysInUse": [ 6 | "date.long.*", 7 | "yeah" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /res/flags/ch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/fi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/ro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/sd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/.vscode/i18n-ally-custom-framework.yml: -------------------------------------------------------------------------------- 1 | languageIds: 2 | - javascript 3 | - typescript 4 | - javascriptreact 5 | - typescriptreact 6 | scopeRangeRegex: "customScopeRangeFn\\(\\s*\\[?\\s*['\"`](.*?)['\"`]" 7 | monopoly: false 8 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/README.md: -------------------------------------------------------------------------------- 1 | # 100 Locales 2 | 3 | - There is no 100 locales, just saying. 4 | - The locales are random picked and not containing all of country/regions. 5 | - Only for testing propose, not actually working and doesn't represent anything. 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@fluent/bundle": "^0.16.0", 7 | "fluent-vue": "^3.0.0-beta.16", 8 | "vue": "~2.6.12" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/locales/index.js: -------------------------------------------------------------------------------- 1 | import i18n from "i18n-js"; 2 | 3 | import en from "./en.json"; 4 | import sk from "./sk.json"; 5 | 6 | i18n.translations = { 7 | en, 8 | sk, 9 | }; 10 | i18n.locale = "sk"; 11 | 12 | export default i18n; 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/src/locales/index.ts: -------------------------------------------------------------------------------- 1 | import { createI18n } from 'next-international' 2 | 3 | export const { useI18n, useScopedI18n, I18nProvider, getLocaleProps } = createI18n({ 4 | en: () => import('./en'), 5 | fr: () => import('./fr') 6 | }) -------------------------------------------------------------------------------- /res/flags/es-ca.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background-color: darkslateblue; 3 | border-radius: 5px; 4 | color: white; 5 | padding: 5px; 6 | width: 10%; 7 | margin: 5px; 8 | text-decoration: none; 9 | cursor: pointer; 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest1.tsx: -------------------------------------------------------------------------------- 1 | import { getTranslations } from 'next-intl/server' 2 | 3 | export default async function GetTranslationsTest1() { 4 | const t = await getTranslations() 5 | return

{t('IndexPage.title')}

6 | } 7 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest2.tsx: -------------------------------------------------------------------------------- 1 | import { getTranslations } from 'next-intl/server' 2 | 3 | export default async function GetTranslationsTest2() { 4 | const t = await getTranslations('IndexPage') 5 | return

{t('title')}

6 | } 7 | -------------------------------------------------------------------------------- /res/flags/is.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/mu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/tt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "��ʾ", 3 | "hello": "��ã�", 4 | "good_morning": "���Ϻ�", 5 | "some": { 6 | "deep": { 7 | "nested": { 8 | "encoding": "GBK" 9 | } 10 | } 11 | }, 12 | "intro": "" 13 | } 14 | -------------------------------------------------------------------------------- /res/flags/cg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/kw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/qa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/app.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | i18n.t('hello') 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | i18n.t('color') 11 | 12 | 13 | 14 | i18n.t('weekdays.friday') 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | i18n.t('weekdays.monday') 26 | -------------------------------------------------------------------------------- /examples/by-features/module-style/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "src/locales", 3 | "i18n-ally.enabledFrameworks": ["next-international"], 4 | "eslint.enable": false, 5 | "i18n-ally.enabledParsers": ["ts"], 6 | "i18n-ally.keystyle": "flat" 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/messages/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "IndexPage": { 3 | "description": "Some description", 4 | "title": "next-intl example" 5 | }, 6 | "Metadata": { 7 | "title": "Page title" 8 | }, 9 | "Test": { 10 | "title": "Test" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/by-features/linked/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Démo", 3 | "some": { 4 | "deep": { 5 | "nested": { 6 | "key": "Imbriqué!" 7 | } 8 | } 9 | }, 10 | "linked": "", 11 | "intro": "Apporte une meilleure expérience de traduction" 12 | } 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/messages/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "IndexPage": { 3 | "description": "Eine Beschreibung", 4 | "title": "next-intl Beispiel" 5 | }, 6 | "Metadata": { 7 | "title": "Seitentitel" 8 | }, 9 | "Test": { 10 | "title": "Test" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /res/flags/ae.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/ne.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/to.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/flags/tz.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint", 6 | "lokalise.i18n-ally", 7 | "amodio.tsl-problem-matcher", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue-sfc/src/fluent.js: -------------------------------------------------------------------------------- 1 | import { FluentBundle } from '@fluent/bundle' 2 | import { createFluentVue } from 'fluent-vue' 3 | 4 | const bundle = new FluentBundle('en') 5 | 6 | export const fluent = createFluentVue({ 7 | locale: 'en', 8 | bundles: [bundle], 9 | }) 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue/src/fluent.js: -------------------------------------------------------------------------------- 1 | import { FluentBundle } from '@fluent/bundle' 2 | import { createFluentVue } from 'fluent-vue' 3 | 4 | const bundle = new FluentBundle('en') 5 | 6 | export const fluent = createFluentVue({ 7 | locale: 'en', 8 | bundles: [bundle], 9 | }) 10 | -------------------------------------------------------------------------------- /res/dark/collection.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/dz.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gm.svg: -------------------------------------------------------------------------------- 1 | 2 | Flag of The Gambia 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/light/collection.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/webview/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/chrome-extension/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "errorRemoved": { 3 | "message": "Removed", 4 | "description": "" 5 | }, 6 | "showInFolderTitle": { 7 | "message": "Show in Folder", 8 | "description": "Alt text for show in folder icon" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /examples/by-features/100-locales/locales/en-us.yml: -------------------------------------------------------------------------------- 1 | color: Color 2 | goodbye: Goodbye 3 | hello: Hi there 4 | thanks: Thank you! 5 | weekdays: 6 | friday: Friday 7 | monday: Monday 8 | saturday: Saturday 9 | sunday: Sunday 10 | thursday: Thursday 11 | tuesday: Tuesday 12 | wednesday: Wednesday 13 | -------------------------------------------------------------------------------- /res/flags/mv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/flags/sc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "public/locales", 3 | "i18n-ally.enabledFrameworks": ["react", "i18next", "custom"], 4 | "i18n-ally.namespace": true, 5 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", 6 | "i18n-ally.keystyle": "nested" 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/src/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-use-before-define 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | import App from './App' 5 | 6 | import './i18n' 7 | 8 | ReactDOM.render(, document.getElementById('root')) 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/.vscode/i18n-ally-custom-framework.yml: -------------------------------------------------------------------------------- 1 | # .vscode/i18n-ally-custom-framework.yml 2 | languageIds: 3 | - javascript 4 | - typescript 5 | - javascriptreact 6 | - typescriptreact 7 | - vue 8 | usageMatchRegex: 9 | - "[^\\w\\d]customT\\(['\"`]({key})['\"`]" 10 | monopoly: false 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/lingui.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | locales: ["en", "cs"], 3 | sourceLocale: "en", 4 | catalogs: [ 5 | { 6 | path: "/locale/{locale}/messages", 7 | include: ["/"], 8 | exclude: ["**/node_modules/**"], 9 | }, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /res/dark/checkmark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/lc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/light/checkmark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/by-features/encoding/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Demo", 3 | "hello": "Hello!", 4 | "good_morning": "Good morning", 5 | "some": { 6 | "deep": { 7 | "nested": { 8 | "encoding": "UTF-8" 9 | } 10 | } 11 | }, 12 | "intro": "Brings a better translating experience." 13 | } 14 | -------------------------------------------------------------------------------- /res/flags/gh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/by-features/js-parser/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.enabledParsers": [ 4 | "ts", 5 | "js" 6 | ], 7 | "i18n-ally.sourceLanguage": "en", 8 | "i18n-ally.theme.annotationMissingBorder": "#d37070", 9 | "i18n-ally.theme.annotationMissing": "#d37070" 10 | } 11 | -------------------------------------------------------------------------------- /res/dark/help-star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/light/help-star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/commands/manipulations/copyKey.ts: -------------------------------------------------------------------------------- 1 | import { window, env } from 'vscode' 2 | import { LocaleTreeItem } from '~/views' 3 | import i18n from '~/i18n' 4 | 5 | export async function CopyKey({ node }: LocaleTreeItem) { 6 | await env.clipboard.writeText(node.keypath) 7 | window.showInformationMessage(i18n.t('prompt.key_copied')) 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-features/custom-locales-path/lang/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "nested": { 3 | "hello": "また会いましたね", 4 | "greeting": "おはようございます" 5 | }, 6 | "yeah": "Good", 7 | "project": "基本", 8 | "tos": "利用規約", 9 | "term": "{0}を受け入れます", 10 | "currency": { 11 | "style": "currency", 12 | "currency": "JPY" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/by-features/json5/locales/ja.my-custom-ext: -------------------------------------------------------------------------------- 1 | { 2 | apple: 'Good', 3 | currency: { 4 | currency: 'JPY', 5 | style: 'currency', 6 | }, 7 | nested: { 8 | greeting: 'おはようございます', 9 | hello: 'また会いましたね', 10 | }, 11 | project: '基本', 12 | term: '{0}を受け入れます', 13 | tos: '利用規約', 14 | yeah: 'ええ', 15 | } 16 | -------------------------------------------------------------------------------- /examples/by-features/tag-system-bcp47/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "locales", 3 | "i18n-ally.languageTagSystem": "bcp47", 4 | "i18n-ally.sourceLanguage": "en", 5 | "i18n-ally.keystyle": "nested", 6 | "i18n-ally.translate.saveAsCandidates": true, 7 | "i18n-ally.enabledFrameworks": ["vue", "react"] 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest3.tsx: -------------------------------------------------------------------------------- 1 | import { getTranslations } from 'next-intl/server' 2 | 3 | export default async function GetTranslationsTest3() { 4 | const t = await getTranslations({ 5 | locale: 'en', 6 | namespace: 'IndexPage', 7 | }) 8 | return

{t('title')}

9 | } 10 | -------------------------------------------------------------------------------- /res/flags/de.svg: -------------------------------------------------------------------------------- 1 | 2 | Flag of Germany 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/packagesParsers/gemfile.ts: -------------------------------------------------------------------------------- 1 | import { PackageParser } from './base' 2 | 3 | export class GemfileParser extends PackageParser { 4 | static filename = 'Gemfile' 5 | 6 | protected static parserRaw(raw: string) { 7 | if (raw.match(/gem ["']rails-i18n['"]/)) 8 | return ['rails-i18n'] 9 | return [] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/views/ViewIds.ts: -------------------------------------------------------------------------------- 1 | 2 | export enum ViewIds { 3 | progress = 'i18n-ally-locales-progress', 4 | tree = 'i18n-ally-locales-tree', 5 | feedback = 'i18n-ally-help-feedback', 6 | usage = 'i18n-ally-locales-usage', 7 | file = 'i18n-ally-locales-sidebar-file', 8 | file_in_explorer = 'i18n-ally-locales-file-explorer', 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-features/flatten-mode/lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Basic", 3 | "car": "car | cars", 4 | "apple": "no apples | one apple | {count} apples", 5 | "tos": "Term of Service", 6 | "term": "I accept {0}", 7 | "nested.hello": "Hello again", 8 | "nested.greeting": "good morning", 9 | "nested.foo.bar": "foobar" 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/vue/scripts/v2-esm.js: -------------------------------------------------------------------------------- 1 | // https://github.com/nuxt/nuxt.js/blob/dev/examples/hello-world/pages/about.vue 2 | export default { 3 | asyncData () { 4 | return { 5 | name: process.static ? 'static' : (process.server ? 'server' : 'client') 6 | } 7 | }, 8 | head: { 9 | title: 'About page' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "custom-scope-range", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "i18next": "20.3.0", 7 | "i18next-xhr-backend": "3.2.2", 8 | "react": "17.0.2", 9 | "react-dom": "17.0.2", 10 | "react-i18next": "11.9.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/by-features/demo/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Démo", 3 | "some": { 4 | "deep": { 5 | "nested": { 6 | "key": "Imbriqué!" 7 | } 8 | } 9 | }, 10 | "nice": "Nice", 11 | "intro": "Apporte une meilleure expérience de traduction", 12 | "hello": "salut!", 13 | "good_morning": "Bonjour" 14 | } 15 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n/locales/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "apple": "Good", 3 | "currency": { 4 | "currency": "JPY", 5 | "style": "currency" 6 | }, 7 | "nested": { 8 | "greeting": "おはようございます", 9 | "hello": "また会いましたね" 10 | }, 11 | "project": "基本", 12 | "term": "{0}を受け入れます", 13 | "tos": "利用規約", 14 | "yeah": "ええ" 15 | } -------------------------------------------------------------------------------- /res/flags/es-eu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/tagSystems/none.ts: -------------------------------------------------------------------------------- 1 | import { BCP47 } from './bcp47' 2 | 3 | // extending BCP47 to try to get flag from BCP47 format if possible 4 | // but do nothing on normalization 5 | export class NoneTagSystem extends BCP47 { 6 | // no conversion 7 | normalize(locale?: string, fallback = 'en') { 8 | return locale || fallback 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue/i18n/en.ftl: -------------------------------------------------------------------------------- 1 | user-name = World 2 | aria-key = Aria value 3 | # {$name} Name of current user 4 | greeting = Hello, { $name } 5 | .aria-label = Label value 6 | test = Test value 7 | props = .aria-label = Aria 8 | .aria-label = Aria 9 | term = I accept { $tos-link } 10 | .terms-link-text = Term of Service 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/public/locales/de/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Willkommen zu react und react-i18next", 3 | "description": { 4 | "part1": "Um loszulegen, ändere <1>src/App(DE).js speicheren und neuladen.", 5 | "part2": "Ändere die Sprachen zwischen deutsch und englisch mit Hilfe der beiden Schalter." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/vuex-i18n/todo-demo/app/app.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /examples/by-frameworks/fluent-vue-sfc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@fluent/bundle": "^0.16.0", 7 | "fluent-vue": "^3.0.0-beta.16", 8 | "vue": "~2.6.12" 9 | }, 10 | "devDependencies": { 11 | "fluent-vue-loader": "^3.0.0-beta.16" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-international/src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import { I18nProvider } from '../locales' 2 | import { AppProps } from 'next/app' 3 | 4 | export default function App({ Component, pageProps }: AppProps) { 5 | return ( 6 | 7 | 8 | 9 | ) 10 | } -------------------------------------------------------------------------------- /res/flags/cu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/fixtures/js/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.enabledFrameworks": ["general"], 3 | "i18n-ally.localesPaths": ".", 4 | "i18n-ally.pathMatcher": "messages.{locale}.json", 5 | "i18n-ally.enabledParsers": ["json"], 6 | "i18n-ally.displayLanguage": "en", 7 | "i18n-ally.sourceLanguage": "en", 8 | "i18n-ally.keystyle": "nested" 9 | } 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/src/middleware.tsx: -------------------------------------------------------------------------------- 1 | import createMiddleware from 'next-intl/middleware' 2 | 3 | export default createMiddleware({ 4 | locales: ['en', 'de'], 5 | defaultLocale: 'en', 6 | }) 7 | 8 | export const config = { 9 | // Skip all paths that should not be internationalized 10 | matcher: ['/((?!api|_next|.*\\..*).*)'], 11 | } 12 | -------------------------------------------------------------------------------- /res/flags/gb-sct.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/packagesParsers/composerJSON.ts: -------------------------------------------------------------------------------- 1 | import { PackageParser } from './base' 2 | 3 | export class ComposerJSONParser extends PackageParser { 4 | static filename = 'composer.json' 5 | 6 | protected static parserRaw(raw: string) { 7 | const { 8 | require = {}, 9 | } = JSON.parse(raw) 10 | 11 | return Object.keys(require) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/tagSystems/index.ts: -------------------------------------------------------------------------------- 1 | import { NoneTagSystem } from './none' 2 | import { BCP47 } from './bcp47' 3 | import { BaseTagSystem } from './base' 4 | import { LegacyTagSystem } from './legacy' 5 | 6 | export const TagSystems: Record = { 7 | none: new NoneTagSystem(), 8 | bcp47: new BCP47(), 9 | legacy: new LegacyTagSystem(), 10 | } 11 | -------------------------------------------------------------------------------- /examples/by-features/yaml/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "public/locales", 3 | "i18n-ally.enabledFrameworks": ["i18next-shopify"], 4 | "i18n-ally.namespace": true, 5 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", 6 | "i18n-ally.keystyle": "nested", 7 | "i18n-ally.keysInUse": ["description.part2_whatever"] 8 | } 9 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/public/locales/en/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "hello", 3 | "description": { 4 | "part1": "To get started, edit <1>src/App.js and save to reload.", 5 | "part2": "Switch language between english and german using buttons above." 6 | }, 7 | "titlew": "ok", 8 | "foo": { 9 | "bar": "foobar" 10 | } 11 | } -------------------------------------------------------------------------------- /res/flags/fo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/flags/sr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/public/locales/en/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "hello", 3 | "description": { 4 | "part1": "To get started, edit <1>src/App.js and save to reload.", 5 | "part2": "Switch language between english and german using buttons above." 6 | }, 7 | "titlew": "ok", 8 | "foo": { 9 | "bar": "foobar" 10 | } 11 | } -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/src/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | import './index.css' 5 | import App from './App' 6 | 7 | // import i18n (needs to be bundled ;)) 8 | import './i18n' 9 | 10 | ReactDOM.render(, document.getElementById('root')) 11 | -------------------------------------------------------------------------------- /res/dark/help-heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/aw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /res/flags/gy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/flags/wf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/light/help-heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/commands/manipulations/markKeyInUse.ts: -------------------------------------------------------------------------------- 1 | import { uniq } from 'lodash' 2 | import { LocaleTreeItem } from '~/views' 3 | import { Config } from '~/core' 4 | 5 | export async function markKeyInUse(item?: LocaleTreeItem) { 6 | if (!item) 7 | return 8 | 9 | const keypath = item.node.keypath 10 | Config.keysInUse = uniq([...Config.keysInUse, keypath]) 11 | } 12 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/src/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | import './index.css' 5 | import App from './App' 6 | 7 | // import i18n (needs to be bundled ;)) 8 | import './i18n' 9 | 10 | ReactDOM.render(, document.getElementById('root')) 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/non-i18n-project/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /res/flags/bv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/flags/no.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/flags/sj.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/by-features/collections/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "key1": "this is message1", 3 | "nested": { 4 | "message1": "this is nested message1" 5 | }, 6 | "errors": [ 7 | "this is 0 error code message", 8 | { 9 | "internal1": "this is internal 1 error message" 10 | }, 11 | [ 12 | "this is nested array error 1" 13 | ] 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /res/dark/review-conflict.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/tr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/ax.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/App.view.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/laravel/resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'numeric' => 'The :attribute may not be greater than :max.', 6 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 7 | 'string' => 'The :attribute may not be greater than :max characters.', 8 | 'array' => 'The :attribute may not have more than :max items.', 9 | ], 10 | ]; 11 | -------------------------------------------------------------------------------- /examples/by-frameworks/vuex-i18n/todo-demo/app/routes.js: -------------------------------------------------------------------------------- 1 | import Todos from 'components/todos.vue' 2 | import About from 'components/about.vue' 3 | 4 | const routes = [ 5 | { 6 | path: '/todo/:status?', 7 | name: 'todos', 8 | component: Todos, 9 | props: true, 10 | alias: ['/'], 11 | }, { 12 | path: '/about', 13 | name: 'about', 14 | component: About, 15 | }, 16 | ] 17 | 18 | export default routes 19 | -------------------------------------------------------------------------------- /res/dark/review-comment.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | 3 | These are some scenario samples to use `i18n-ally`. 4 | 5 | You can browser them [**by Frameworks**](./by-frameworks) or [**by Features**](./by-features) 6 | 7 | > 💡 Note the examples are **NOT** starter templates. They only contain files that needed by `i18n-ally` but not build configs, framework setups etc. If you are looking for starter templates, please visit the offical site of the corresponding framework. 8 | -------------------------------------------------------------------------------- /examples/by-frameworks/jekyll/_pages/404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | not_in_footer: true 4 | ref: four_hundred_four 5 | --- 6 | 7 |
8 |
9 |

404

10 |

{% t four_hundred_four.page_not_found %}

11 |

{% t four_hundred_four.turn_back_home %}

12 |
13 |
14 | -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webpack: (config, { isServer }) => { 3 | config.module.rules = [ 4 | ...config.module.rules, 5 | { 6 | test: /\.po/, 7 | use: [ 8 | { 9 | loader: "@lingui/loader", 10 | }, 11 | ], 12 | }, 13 | ]; 14 | 15 | return config; 16 | }, 17 | future: { 18 | webpack5: true, 19 | }, 20 | } -------------------------------------------------------------------------------- /res/dark/review-suggestions.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/by-frameworks/svelte/src/i18n.js: -------------------------------------------------------------------------------- 1 | import { register, init, getLocaleFromNavigator } from 'svelte-i18n' 2 | 3 | register('en', () => import('../messages/en.json')) 4 | register('pt-BR', () => import('../messages/pt-BR.json')) 5 | register('es-ES', () => import('../messages/es-ES.json')) 6 | register('ar', () => import('../messages/ar.json')) 7 | 8 | init({ 9 | fallbackLocale: 'en', 10 | initialLocale: getLocaleFromNavigator(), 11 | }) 12 | -------------------------------------------------------------------------------- /res/dark/empty.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/cf.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "esnext", 5 | "lib": ["ESNext"], 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "skipLibCheck": true, 10 | "outDir": "../e2e-out", 11 | "paths": { 12 | "~/*": ["../../dist/src/*"] 13 | } 14 | }, 15 | "exclude": [ 16 | "../../src/", 17 | "../../dist/" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n-ally.localesPaths": "public/locales", 3 | "i18n-ally.enabledFrameworks": [ 4 | "react-i18next" 5 | ], 6 | "i18n-ally.namespace": true, 7 | "i18n-ally.pathMatcher": "{locale}/{namespaces}.json", 8 | "i18n-ally.keystyle": "nested", 9 | "i18n-ally.keysInUse": [ 10 | "description.part2_whatever" 11 | ], 12 | // "i18n-ally.defaultNamespace": "translation" 13 | } 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/vuex-i18n/todo-demo/app/store/actions.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | // add a new todo item 4 | addTodo ({ commit }, txt) { 5 | commit('addTodo', txt) 6 | }, 7 | 8 | // remove the given todo tiem 9 | removeTodo ({ commit }, id) { 10 | commit('removeTodo', id) 11 | }, 12 | 13 | // mark the given todo item as done or not done 14 | toggleTodo ({ commit }, id) { 15 | commit('toggleTodo', id) 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /src/extraction/parsers/utils.ts: -------------------------------------------------------------------------------- 1 | import { DetectionResult } from '~/core/types' 2 | 3 | const keys = ['start', 'end', 'fullStart', 'fullEnd'] as const 4 | 5 | export function shiftDetectionPosition(result: DetectionResult[], offest: number) { 6 | return result.map((i) => { 7 | const data = { ...i } 8 | for (const key of keys) { 9 | if (data[key] != null) 10 | data[key] += offest 11 | } 12 | return data 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /examples/by-frameworks/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/index.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/core/mvc/XMLView", 3 | "sap/ui/model/resource/ResourceModel" 4 | ], function (XMLView, ResourceModel) { 5 | "use strict"; 6 | 7 | var i18nModel = new ResourceModel({ 8 | bundleName: "Quickstart.i18n.i18n" 9 | }); 10 | 11 | XMLView.create({viewName: "Quickstart.App"}).then(function (oView) { 12 | oView.setModel(i18nModel, "i18n"); 13 | oView.placeAt("content"); 14 | }); 15 | }); -------------------------------------------------------------------------------- /res/flags/ly.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/views/items/ProgressTranslatedListItem.ts: -------------------------------------------------------------------------------- 1 | import { ProgressSubmenuItem } from './ProgressSubmenuItem' 2 | import { ProgressRootItem } from './ProgressRootItem' 3 | 4 | export class ProgressTranslatedListItem extends ProgressSubmenuItem { 5 | constructor(protected root: ProgressRootItem) { 6 | super(root, 'view.progress_submenu.translated_keys', 'checkmark') 7 | } 8 | 9 | getKeys() { 10 | return this.root.node.translatedKeys 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/parsers/properties.ts: -------------------------------------------------------------------------------- 1 | 2 | // @ts-ignore 3 | import properties from 'properties' 4 | import { Parser } from './base' 5 | 6 | export class Properties extends Parser { 7 | id = 'properties' 8 | 9 | constructor() { 10 | super(['properties'], 'properties') 11 | } 12 | 13 | async parse(text: string) { 14 | return properties.parse(text) 15 | } 16 | 17 | async dump(object: object) { 18 | return properties.stringify(object) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngx-translate/src/should_ignore.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /scripts/build-flags.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fg from 'fast-glob' 3 | import fs from 'fs-extra' 4 | 5 | ;(async() => { 6 | const files = await fg('./res/flags/*.svg') 7 | const flags = files.map(file => path.basename(file, '.svg')) 8 | const output = path.resolve('./src/utils/flags.ts') 9 | 10 | await fs.writeFile(output, `// Generated by npm run flags:build\nexport const FLAGS = [\n${flags.map(f => ` '${f}',\n`).join('')}]\n`, 'utf-8') 11 | })() 12 | -------------------------------------------------------------------------------- /examples/by-features/extractions/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Demo", 3 | "hello": "Hello!", 4 | "good_morning": "Good morning", 5 | "some": { 6 | "deep": { 7 | "nested": { 8 | "key": "Nested!" 9 | } 10 | } 11 | }, 12 | "intro": "Brings a better translating experience", 13 | "hi": "Hi", 14 | "yes": { 15 | "no": { 16 | "and": "good" 17 | } 18 | }, 19 | "yad": "asd", 20 | "saved-boards": "Saved boards" 21 | } 22 | -------------------------------------------------------------------------------- /examples/by-features/linked/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "Demo", 3 | "hello": "Hello!", 4 | "good_morning": "Good morning", 5 | "some": { 6 | "deep": { 7 | "nested": { 8 | "key": "Nested!" 9 | } 10 | } 11 | }, 12 | "linked": "@:project @.upper:hello", 13 | "intro": "Brings a better translating experience", 14 | "hi": "Hi", 15 | "yes": { 16 | "no": { 17 | "and": "good" 18 | } 19 | }, 20 | "yad": "asd" 21 | } 22 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/public/locales/de/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Willkommen zu react und react-i18next", 3 | "description": { 4 | "part1": "Um loszulegen, ändere <1>src/App(DE).js speicheren und neuladen.", 5 | "part2": "Ändere die Sprachen zwischen deutsch und englisch mit Hilfe der beiden Schalter." 6 | }, 7 | "count": { 8 | "one": "{{count}} Satz übersetzt!", 9 | "other": "{{count}} Sätze übersetzt!" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './Global' 3 | export * from './KeyDetector' 4 | export * from './Config' 5 | export * from './CurrentFile' 6 | export * from './Translator' 7 | export * from './Analyst' 8 | export * from './Errors' 9 | export * from './Nodes' 10 | export * from './Extract' 11 | export * from './Telemetry' 12 | export * from './loaders/Loader' 13 | export * from './loaders/VueSfcLoader' 14 | export * from './loaders/LocaleLoader' 15 | -------------------------------------------------------------------------------- /src/packagesParsers/pubspecYAML.ts: -------------------------------------------------------------------------------- 1 | import YAML from 'js-yaml' 2 | import { PackageParser } from './base' 3 | 4 | export class PubspecYAMLParser extends PackageParser { 5 | static filename = 'pubspec.yaml' 6 | 7 | protected static parserRaw(raw: string) { 8 | const { 9 | dependencies = {}, 10 | dev_dependencies = {}, 11 | } = YAML.load(raw) as any 12 | 13 | return [...Object.keys(dependencies), ...Object.keys(dev_dependencies)] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18n-js/src/App.js: -------------------------------------------------------------------------------- 1 | import './App.css'; 2 | import i18n from './locales'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 |

9 | {i18n.t('home.headline')} 10 |

11 |

12 | Edit ./src/locales/index.js to try different language. 13 |

14 |
15 |
16 | ); 17 | } 18 | 19 | export default App; 20 | -------------------------------------------------------------------------------- /test/fixture-scripts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "esnext", 5 | "lib": ["ESNext"], 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "resolveJsonModule": true, 10 | "outDir": "../fixture-scripts-out", 11 | "paths": { 12 | "~/*": ["../../dist/src/*"] 13 | } 14 | }, 15 | "exclude": [ 16 | "../../src/", 17 | "../../dist/" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /examples/by-frameworks/custom/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "apple": "no apples | one apple | {count} apples", 3 | "car": "car | cars", 4 | "currency": { 5 | "currency": "USD", 6 | "style": "currency" 7 | }, 8 | "nested": { 9 | "foo": { 10 | "bar": "foobar" 11 | }, 12 | "greeting": "good morning", 13 | "hello": "Hello again" 14 | }, 15 | "project": "Basic", 16 | "term": "I accept {0}", 17 | "tos": "Term of Service", 18 | "yeah": "yeah" 19 | } 20 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import en from '../locales/en.json' 4 | import ja from '../locales/ja.json' 5 | import App from './App.vue' 6 | 7 | Vue.config.productionTip = false 8 | Vue.use(VueI18n) 9 | 10 | const i18n = new VueI18n({ 11 | locale: 'en', 12 | messages: { 13 | en, 14 | ja, 15 | }, 16 | }) 17 | 18 | new Vue({ 19 | i18n, 20 | render: h => h(App), 21 | }).$mount('#app') 22 | -------------------------------------------------------------------------------- /res/dark/help-report-issue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /res/flags/ss.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/light/help-report-issue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './utils' 2 | export * from './UnicodeDecorator' 3 | export * from './UnicodeProgressBar' 4 | export * from './NodeHelper' 5 | export * from './Log' 6 | export * from './LanguageId' 7 | export * from './File' 8 | export * from './Regex' 9 | export * from './flat' 10 | export * from './flags' 11 | export * from './cache' 12 | export * from './PathMatcher' 13 | export * from './prompts' 14 | export * from './shared' 15 | export * from './keypathValidate' 16 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-translate/components/no-functional-component.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import withTranslation from 'next-translate/withTranslation' 3 | 4 | class NoFunctionalComponent extends React.Component { 5 | render(){ 6 | const { t, lang } = this.props.i18n 7 | 8 | return ( 9 |
10 | {t('more-examples:no-functional-example')} 11 |
12 | ) 13 | } 14 | } 15 | 16 | export default withTranslation(NoFunctionalComponent) 17 | -------------------------------------------------------------------------------- /examples/by-frameworks/ui5/webapp/App.controller.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/core/mvc/Controller", 3 | "sap/m/MessageToast" 4 | ], function (Controller, MessageToast) { 5 | "use strict"; 6 | 7 | return Controller.extend("Quickstart.App", { 8 | onPress : function () { 9 | MessageToast.show(this.getResourceBundle().getText("hello")); 10 | }, 11 | getResourceBundle: function(){ 12 | return this.getView().getModel("i18n").getResourceBundle(); 13 | } 14 | }); 15 | 16 | }); -------------------------------------------------------------------------------- /examples/by-frameworks/flutter/assets/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "App di test", 3 | "label": { 4 | "main": "Ciao {user}!" 5 | }, 6 | "button": { 7 | "label": { 8 | "clickMe": "Premi qui", 9 | "language": "Cambia lingua" 10 | }, 11 | "toastMessage": "Hai premuto un bottone!" 12 | }, 13 | "clicked": { 14 | "times-0": "Hai premuto {times} volte!", 15 | "times-1": "Hai premuto {time} volta!", 16 | "times-2": "Hai premuto {times} volte!" 17 | } 18 | } -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/public/locales/en/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "hello", 3 | "description": { 4 | "part1": "To get started, edit <1>src/App.js and save to reload.", 5 | "part2": "Switch language between english and german using buttons above." 6 | }, 7 | "titlew": "ok", 8 | "foo": { 9 | "bar": "foobar" 10 | }, 11 | "count": { 12 | "one": "{{count}} phrase translated!", 13 | "other": "{{count}} phrases translated!" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | React App 8 | 9 | 10 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/by-frameworks/flutter/assets/i18n/en.yaml: -------------------------------------------------------------------------------- 1 | title: "Test app" 2 | 3 | # With yaml, you can also comment your translations 4 | label: 5 | main: "Hello {user}!" 6 | 7 | # Objects can be many levels deep 8 | button: 9 | label: 10 | clickMe: "Click here" 11 | language: "Change language" 12 | toastMessage: "You clicked on button!" 13 | 14 | clicked: 15 | times-0: "You clicked {times} times!" 16 | times-1: "You clicked {time} time!" 17 | times-2: "You clicked {times} times!" 18 | -------------------------------------------------------------------------------- /examples/by-frameworks/i18next-shopify/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | React App 8 | 9 | 10 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/by-frameworks/php-po/index.php: -------------------------------------------------------------------------------- 1 | '; 16 | echo gettext('good-morning') . '
'; 17 | ?> 18 | -------------------------------------------------------------------------------- /examples/by-frameworks/react-i18next/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | React App 8 | 9 | 10 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /src/views/items/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Base' 2 | export * from './FeedbackItem' 3 | export * from './LocaleTreeItem' 4 | export * from './LocationTreeItem' 5 | export * from './ProgressBaseItem' 6 | export * from './ProgressEmptyListItem' 7 | export * from './ProgressMissingListItem' 8 | export * from './ProgressRootItem' 9 | export * from './ProgressSubmenuItem' 10 | export * from './ProgressTranslatedListItem' 11 | export * from './UsageReportRootItem' 12 | export * from './UsageReportTreeItem' 13 | -------------------------------------------------------------------------------- /examples/by-features/demo/Demo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /examples/by-frameworks/flutter/assets/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Test app", 3 | "label": { 4 | "main": "Hola {user}!" 5 | }, 6 | "button": { 7 | "label": { 8 | "clickMe": "Haga clic aquí", 9 | "language": "cambiar idioma" 10 | }, 11 | "toastMessage": "Hiciste clic en el botón!" 12 | }, 13 | "clicked": { 14 | "times-0": "Hiciste clic {times} veces!", 15 | "times-1": "Hiciste clic {time} vez!", 16 | "times-2": "Hiciste clic {times} veces!" 17 | } 18 | } -------------------------------------------------------------------------------- /examples/by-frameworks/lingui-nextjs/lingui-example/components/PluralExample.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | export function PluralExample({ initialValue = 1, render }) { 4 | const [value, setValue] = React.useState(initialValue) 5 | 6 | return ( 7 |
8 |
{render({ value })}
9 |
10 | setValue(e.target.value as any)} 13 | /> 14 |
15 |
16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /src/packagesParsers/packageJSON.ts: -------------------------------------------------------------------------------- 1 | import { PackageParser } from './base' 2 | 3 | export class PackageJSONParser extends PackageParser { 4 | static filename = 'package.json' 5 | 6 | protected static parserRaw(raw: string) { 7 | const { 8 | dependencies = {}, 9 | devDependencies = {}, 10 | peerDependencies = {}, 11 | } = JSON.parse(raw) 12 | 13 | return [...Object.keys(dependencies), ...Object.keys(devDependencies), ...Object.keys(peerDependencies)] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /res/flags/gg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/by-features/custom-scope-range/src/i18n.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 2 | import React from 'react' 3 | import i18n from 'i18next' 4 | import { initReactI18next } from 'react-i18next' 5 | 6 | i18n 7 | .use(Backend) 8 | .use(initReactI18next) 9 | .init({ 10 | fallbackLng: 'en', 11 | debug: true, 12 | 13 | interpolation: { 14 | escapeValue: false, // not needed for react as it escapes by default 15 | }, 16 | }) 17 | 18 | export default i18n 19 | -------------------------------------------------------------------------------- /examples/by-frameworks/ruby-on-rails/app/views/pages/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= t('.welcome') %>

2 | 3 | <%= t '.bold_text.html' %> 4 | 5 | <%= t 'welcome' %> 6 | 7 |
8 | 9 | <%= number_to_currency 1234567890.50 %>
10 | <%= number_to_human(1234567) %>
11 | <%= number_to_phone(1235551234) %>
12 | <%= number_to_human_size(1234567890) %> 13 | 14 | <%= link_to t('.new_post'), new_post_path %>
15 | <%= link_to t('.posts'), posts_path %> 16 | <%= link_to t(:pages.index.new_post), posts_path %> 17 | -------------------------------------------------------------------------------- /res/flags/ba.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/extraction/rules/dynamic.ts: -------------------------------------------------------------------------------- 1 | import { ExtractionRule, ExtractionScore } from './base' 2 | 3 | export class DynamicExtractionRule extends ExtractionRule { 4 | name = 'dynamic' 5 | 6 | shouldExtract(str: string) { 7 | // includes $t 8 | if (str.match(/(?:^|[$.\b])t\w?\(/u)) 9 | return ExtractionScore.MustExclude 10 | // not quotes at all 11 | if (!str.match(/(?:['"`]|\$\{)/)) 12 | return ExtractionScore.MustExclude 13 | return ExtractionScore.ShouldInclude 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngx-translate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/extraction/rules/index.ts: -------------------------------------------------------------------------------- 1 | import { BasicExtrationRule } from './basic' 2 | import { NonAsciiExtractionRule } from './non-ascii-characters' 3 | import { DynamicExtractionRule } from './dynamic' 4 | 5 | export * from './base' 6 | export * from './basic' 7 | export * from './non-ascii-characters' 8 | 9 | export const DefaultExtractionRules = [ 10 | new BasicExtrationRule(), 11 | new NonAsciiExtractionRule(), 12 | ] 13 | 14 | export const DefaultDynamicExtractionsRules = [ 15 | new DynamicExtractionRule(), 16 | ] 17 | -------------------------------------------------------------------------------- /examples/by-frameworks/ngneat-transloco/app/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

{{ t('hello') }}

5 |

{{ t('some.nested.key') }}

6 |

{{ t('params', { value: 'Transloco'}) }}

7 | 8 |
9 | 10 | 11 |

{{ t('key') }}

12 |
13 | 14 |
15 |

{{ t('key') }}

16 |
17 |
18 | -------------------------------------------------------------------------------- /examples/by-features/extractions/Demo2.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /examples/by-frameworks/vue-i18n-sfc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sfc", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "vue": "^2.6.10", 11 | "vue-i18n": "^8.12.0" 12 | }, 13 | "devDependencies": { 14 | "@intlify/vue-i18n-loader": "^2.1.0", 15 | "@vue/cli-plugin-babel": "^4.5.13", 16 | "@vue/cli-service": "^4.5.13", 17 | "vue-template-compiler": "^2.6.12" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /res/flags/gb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /res/flags/sh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/utils/cache.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * All cached data will lost on vscode reload. 3 | */ 4 | const cache: any = {} 5 | 6 | function hasCache(key: string): boolean { 7 | return Object.hasOwnProperty.call(cache, key) 8 | } 9 | 10 | function setCache(key: string, value: T): T { 11 | cache[key] = value 12 | return value 13 | } 14 | 15 | function getCache(key: string, value?: T): T { 16 | if (cache[key] === undefined) 17 | cache[key] = value 18 | 19 | return cache[key] 20 | } 21 | 22 | export { hasCache, getCache, setCache } 23 | -------------------------------------------------------------------------------- /test/unit/setup.ts: -------------------------------------------------------------------------------- 1 | import { basename, dirname, join } from 'path' 2 | import * as Chai from 'chai' 3 | // @ts-ignore 4 | import Snapshot from 'chai-jest-snapshot' 5 | 6 | before(() => { 7 | Chai.use(Snapshot) 8 | Snapshot.resetSnapshotRegistry() 9 | }) 10 | 11 | beforeEach(function() { 12 | const { currentTest } = this 13 | const file = currentTest!.file! 14 | const path = join(dirname(file), '__snapshots__', `${basename(file)}.snap`) 15 | Snapshot.setFilename(path) 16 | Snapshot.setTestName(currentTest!.fullTitle()) 17 | }) 18 | -------------------------------------------------------------------------------- /res/flags/dj.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /res/flags/gb-nir.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/editor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Translation Editor 7 | 8 | 9 | 10 | 11 |
12 |

{{hello}}

13 | 14 | 15 |
16 | 17 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/by-frameworks/vuex-i18n/todo-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo-vuex-i18n", 3 | "version": "1.1.0", 4 | "description": "Example of todo application with vuex-i18n", 5 | "author": "Department of Clinical Research, University Hospital Basel", 6 | "scripts": { 7 | "dev": "NODE_ENV=development webpack-dev-server --inline --hot" 8 | }, 9 | "dependencies": { 10 | "vue": "2.6.10", 11 | "vue-router": "^4.0.8", 12 | "vuex": "^3.0.1", 13 | "vuex-i18n": "^1.13.1", 14 | "vuex-router-sync": "^5.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /res/flags/pk.svg: -------------------------------------------------------------------------------- 1 | 2 | Flag of Pakistan 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/flags/tw.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/by-frameworks/next-intl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-intl", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "lint": "tsc", 8 | "build": "next build", 9 | "start": "next start" 10 | }, 11 | "dependencies": { 12 | "next": "^13.4.0", 13 | "next-intl": "3.1.2", 14 | "react": "^18.2.0", 15 | "react-dom": "^18.2.0" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^17.0.23", 19 | "@types/react": "^18.2.5", 20 | "typescript": "^5.0.0" 21 | } 22 | } 23 | --------------------------------------------------------------------------------