Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active March 17, 2026 07:16
Show Gist options
  • Select an option

  • Save asika32764/fb766fa60e131eff1a5a2800ad3336df to your computer and use it in GitHub Desktop.

Select an option

Save asika32764/fb766fa60e131eff1a5a2800ad3336df to your computer and use it in GitHub Desktop.
zxcvbn zh-TW translations.
export function getZhTWTranslations() {
return {
warnings: {
straightRow: '鍵盤上連續一排的按鍵很容易被猜到。',
keyPattern: '簡短的鍵盤輸入模式很容易被猜到。',
simpleRepeat: '像「aaa」這樣重複的字元很容易被猜到。',
extendedRepeat:
'像「abcabcabc」這樣重複的字元模式很容易被猜到。',
sequences: '常見的字元序列(例如「abc」)很容易被猜到。',
recentYears: '近期年份很容易被猜到。',
dates: '日期很容易被猜到。',
topTen: '這是非常常見的密碼。',
topHundred: '這是常被使用的密碼。',
common: '這是常見的密碼。',
similarToCommon: '這與常見密碼非常相似。',
wordByItself: '單一單字很容易被猜到。',
namesByThemselves: '單一名字或姓氏很容易被猜到。',
commonNames: '常見的名字與姓氏很容易被猜到。',
userInputs: '密碼中不應包含個人資訊或與此頁面相關的資料。',
pwned: '此密碼曾在網路資料外洩事件中曝光。',
},
suggestions: {
l33t: "避免使用可預測的字母替代,例如用 '@' 代替 'a'。",
reverseWords: '避免將常見單字反向拼寫。',
allUppercase: '只將部分字母改為大寫,而不是全部大寫。',
capitalization: '不只第一個字母大寫。',
dates: '避免使用與你相關的日期或年份。',
recentYears: '避免使用近期年份。',
associatedYears: '避免使用與你相關的年份。',
sequences: '避免使用常見的字元序列。',
repeated: '避免重複使用單字或字元。',
longerKeyboardPattern:
'使用更長的鍵盤輸入模式,並多次改變輸入方向。',
anotherWord: '加入更多較不常見的單字。',
useWords: '使用多個單字,但避免常見片語。',
noNeed:
'即使不使用符號、數字或大寫字母,也能建立強度高的密碼。',
pwned: '如果你在其他地方也使用此密碼,建議立即更換。',
},
timeEstimation: {
ltSecond: '不到 1 秒',
second: '{base} 秒',
seconds: '{base} 秒',
minute: '{base} 分鐘',
minutes: '{base} 分鐘',
hour: '{base} 小時',
hours: '{base} 小時',
day: '{base} 天',
days: '{base} 天',
month: '{base} 個月',
months: '{base} 個月',
year: '{base} 年',
years: '{base} 年',
centuries: '數個世紀',
},
};
}

zxcvbn-ts zh-TW Translations

This is zh-TW translations for zxcvbn-ts package.

Usage

Just copy language file to your project, then import it:

import { getZhTWTranslations } from '...'

// OR just paste function

function getZhTWTranslations() { ... };

Set translations into options:

import { zxcvbn, zxcvbnOptions } from '@zxcvbn-ts/core';

zxcvbnOptions.setOptions({
  translations: getZhTWTranslations(), // <-- here
  dictionary: {
    // ...
  }
});

const result = zxcvbn(password);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment