Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

✨ feat(i18n): Add _t function for direct locale translations #125

Merged
merged 4 commits into from
Apr 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
✨ feat(i18n): Add _t function for direct locale translations
  • Loading branch information
k99k5 committed Apr 7, 2024
commit 480488175b740cbfc89fcfc48c2d50ae969d4cc0
3 changes: 3 additions & 0 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export function useI18n(router = null) {
const locale = getLocale(router);
return sprintf(supportedLocales[locale]?.translation[key] ?? ZH[key] ?? key, ...args);
},
_t(locale, key, ...args) {
return sprintf(supportedLocales[locale]?.translation[key] ?? ZH[key] ?? key, ...args);
},
locale() {
return getLocale(router);
},
Expand Down