mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
WIP(translate): translate converter category all tools
This commit is contained in:
parent
2ee3b01105
commit
2da11a7242
68 changed files with 716 additions and 174 deletions
|
@ -1,3 +1,5 @@
|
|||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export { convertTextToAsciiBinary, convertAsciiBinaryToText };
|
||||
|
||||
function convertTextToAsciiBinary(text: string, { separator = ' ' }: { separator?: string } = {}): string {
|
||||
|
@ -11,7 +13,7 @@ function convertAsciiBinaryToText(binary: string): string {
|
|||
const cleanBinary = binary.replace(/[^01]/g, '');
|
||||
|
||||
if (cleanBinary.length % 8) {
|
||||
throw new Error('Invalid binary string');
|
||||
throw new Error(translate('tools.text-to-binary.invalidBinaryString'));
|
||||
}
|
||||
|
||||
return cleanBinary
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue