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

sort option for locale messages keys for squeezer #6

Open
kazupon opened this issue Aug 28, 2019 · 0 comments
Open

sort option for locale messages keys for squeezer #6

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 = {
  sort?: 'asc' | 'desc'
}

sqeeze (basePath: string, files: SFCFileInfo[], option = { sort: 'asc' }: : Option): LocaleMessages

CLI

vue-i18n-locale-message squeeze --target=./src --sort='desc'

--sort is able to ommit, default is 'asc'

if --sort is asc, should be sorted object keys the following:

{
  "ja": { // for `ja` locale`
    "app": { // src/App.vue
      "lang": "言語切り替え",
      "title": "アプリケーション"
    },
    "components": { // src/components
      "modal": { // src/components/Modal.vue
        "cancel": "キャンセル",
        "ok": "OK"
      }
    },
    "pages": { // src/pages
      "login": { // src/pages/Login.vue
        "button": "ログイン",
        "confirm": "パスワードの確認入力",
        "id": "ユーザーID",
        "password": "パスワード"
      }
    }
  },
  "en": { // for `en` locale
    "app": { // src/App.vue
      "lang": "Change languages",
      "title": "Application"
    },
    "components": { // src/components
      "nest": { // src/components/nest
        "ranking-table": { // src/components/nest/RankingTable.vue
          "headers": {
            "name": "Name",
            "rank": "Rank",
            "score": "Score"
          }
        }
      },
      "modal": { // src/components/Modal.vue
        "cancel": "Cancel",
        "ok": "OK"
      },
    }
  }
}
@kazupon kazupon added Type: Feature Includes new features help wanted Extra attention is needed Status: In Progress Work in Progress todo Status: Proposal Request for comments and removed Status: In Progress Work in Progress Status: Proposal Request for comments 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