Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caml/snake/kebab case option of locale messages hierarcy name for squeezer / infuser #5

Open
kazupon opened this issue Aug 28, 2019 · 0 comments
Labels
help wanted Extra attention is needed Status: Proposal Request for comments todo Type: Feature Includes new features

Comments

@kazupon
Copy link
Member

kazupon commented Aug 28, 2019

API

type Option = {
  casing?: 'caml' | 'snake' | 'kebab'
}

sqeeze (basePath: string, files: SFCFileInfo[], option = { casing: 'caml' }: : Option): LocaleMessages
infuse (basePath: string, sources: SFCFileInfo[], messages: LocaleMessages, option = { casing: 'caml' }: : Option): SFCFileInfo[]

CLI

vue-i18n-locale-message squeeze --target=./src --casing='kebab'
vue-i18n-locale-message infuse --target=./src --message=./message.json --casing='kebab'

--casing is able to commit, default is 'caml'

if --casing is kebab, should be genrated the following:

{
  "ja": { // for `ja` locale`
    "app": { // src/App.vue
      "title": "アプリケーション",
      "lang": "言語切り替え"
    },
    "components": { // src/components
      "modal": { // src/components/Modal.vue
        "ok": "OK",
        "cancel": "キャンセル"
      }
    },
    "pages": { // src/pages
      "login": { // src/pages/Login.vue
        "id": "ユーザーID",
        "password": "パスワード",
        "confirm": "パスワードの確認入力",
        "button": "ログイン"
      }
    }
  },
  "en": { // for `en` locale
    "app": { // src/App.vue
      "title": "Application",
      "lang": "Change languages"
    },
    "components": { // src/components
      "modal": { // src/components/Modal.vue
        "ok": "OK",
        "cancel": "Cancel"
      },
      "nest": { // src/components/nest
        "ranking-table": { // src/components/nest/RankingTable.vue
          "headers": {
            "rank": "Rank",
            "name": "Name",
            "score": "Score"
          }
        }
      }
    }
  }
}
@kazupon kazupon added Type: Feature Includes new features help wanted Extra attention is needed Status: In Progress Work in Progress labels Aug 28, 2019
@kazupon kazupon changed the title caml/snake case option of locale messages hierarcy name for squeezer caml/snake/kebab case option of locale messages hierarcy name for squeezer Aug 28, 2019
@kazupon kazupon changed the title caml/snake/kebab case option of locale messages hierarcy name for squeezer caml/snake/kebab case option of locale messages hierarcy name for squeezer / infuser Aug 28, 2019
@kazupon kazupon added todo Status: Proposal Request for comments and removed Status: In Progress Work in Progress labels Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Status: Proposal Request for comments todo Type: Feature Includes new features
Projects
None yet
Development

No branches or pull requests

1 participant