diff --git a/src/tools/encryption/encryption.vue b/src/tools/encryption/encryption.vue index 4a348f85..931436b9 100644 --- a/src/tools/encryption/encryption.vue +++ b/src/tools/encryption/encryption.vue @@ -2,15 +2,15 @@ import { AES, RC4, Rabbit, TripleDES, enc } from 'crypto-js'; const algos = { AES, TripleDES, Rabbit, RC4 }; - -const cypherInput = ref('Lorem ipsum dolor sit amet'); +const { t } = useI18n(); +const cypherInput = ref(t('tools.encryption.encrypt.text.default')); const cypherAlgo = ref('AES'); -const cypherSecret = ref('my secret key'); +const cypherSecret = ref(t('tools.encryption.encrypt.secretKey.default')); const cypherOutput = computed(() => algos[cypherAlgo.value].encrypt(cypherInput.value, cypherSecret.value).toString()); -const decryptInput = ref('U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs'); +const decryptInput = ref(t('tools.encryption.decrypt.encrypted.default')); const decryptAlgo = ref('AES'); -const decryptSecret = ref('my secret key'); +const decryptSecret = ref(t('tools.encryption.decrypt.secretKey.default')); const decryptOutput = computed(() => algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8), ); @@ -21,26 +21,26 @@ const decryptOutput = computed(() =>
- +
@@ -48,25 +48,25 @@ const decryptOutput = computed(() =>
- +
diff --git a/src/tools/encryption/index.ts b/src/tools/encryption/index.ts index 9a95f4bc..c8dd85db 100644 --- a/src/tools/encryption/index.ts +++ b/src/tools/encryption/index.ts @@ -1,10 +1,11 @@ import { Lock } from '@vicons/tabler'; import { defineTool } from '../tool'; +import { translate } from '@/plugins/i18n.plugin'; export const tool = defineTool({ - name: 'Encrypt / decrypt text', + name: translate('tools.encryption.title'), path: '/encryption', - description: 'Encrypt and decrypt text clear text using crypto algorithm like AES, TripleDES, Rabbit or RC4.', + description: translate('tools.encryption.description'), keywords: ['cypher', 'encipher', 'text', 'AES', 'TripleDES', 'Rabbit', 'RC4'], component: () => import('./encryption.vue'), icon: Lock, diff --git a/src/tools/encryption/locales/en.yml b/src/tools/encryption/locales/en.yml new file mode 100644 index 00000000..e4639587 --- /dev/null +++ b/src/tools/encryption/locales/en.yml @@ -0,0 +1,37 @@ +tools: + encryption: + title: 'Encrypt / decrypt text' + description: 'Encrypt and decrypt text clear text using crypto algorithm like AES, TripleDES, Rabbit or RC4.' + + encrypt: + text: + label: 'Your text' + placeholder: 'The string to cypher' + default: 'Lorem ipsum dolor sit amet' + secretKey: + label: 'Your secret key' + default: 'my secret key' + algorithm: + label: 'Encryption algorithm' + encrypted: + label: 'Your text encrypted' + placeholder: 'Your string hash' + decrypt: + encrypted: + label: 'Your encrypted text' + placeholder: 'The string to cypher' + default: 'U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs' + secretKey: + label: 'Your secret key' + default: 'my secret key' + algorithm: + label: 'Encryption algorithm' + text: + label: 'Your decrypted text' + placeholder: 'Your string hash' + + + + + +