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

Add Russian localization #135

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions public/locales/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Input a regular expression": "输入一条正则表达式",
"Characters": "字符",
"Direct match characters": "直接匹配字符串",
"Character classes:": "字符类",
"Character classes": "字符类",
"Distinguish different types of characters": "区分不同类型的字符",
"Ranges": "范围",
"One of": "其一",
Expand All @@ -25,15 +25,15 @@
"Matches \"x\" and stores it on the groups property of the returned matches under the name specified by <Name>": "匹配 “x” 并将其存储在返回的匹配项的groups属性中,该属性位于 <Name> 指定的名称下",
"Back reference": "反向引用",
"A back reference to match group #1": "匹配组 #1 的反向引用",
"A back reference to match group #name": "匹配组 #name 的反向引用",
"A back reference to match group #Name": "匹配组 #Name 的反向引用",
"Assertion": "断言",
"Begin with": "以...开始",
"End with": "以...结束",
"Begins with": "以...开始",
"Ends with": "以...结束",
"Matches the beginning of input": "匹配输入的开头",
"Followed by:": "接着:",
"Not followed by:": "不接着:",
"Preceded by:": "前面是",
"Not Preceded by:": "前面不是:",
"Preceded by:": "前面是:",
"Not preceded by:": "前面不是:",
"WordBoundary": "单词边界",
"NonWordBoundary": "非单词边界",
"Matches \"x\" only if \"x\" is followed by \"y\"": "x 被 y 跟随时匹配 x",
Expand Down
125 changes: 125 additions & 0 deletions public/locales/ru/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"Home": "Главная",
"Samples": "Примеры",
"Legends": "Справка",
"Edit": "Редактор",
"You have to select nodes first": "Сначала выберите узел на графе",
"Test": "Проверка",
"You can select nodes by dragging or clicking on the graph": "Узлы на графе можно выбрать выделением или по клику",
"Input a regular expression": "Введите регулярное выражение",
"Flags: ": "Флаги: ",
"Characters": "Символы",
"Direct match characters": "Поиск буквального соответствия",
"Character classes": "Символьные классы",
"Distinguish different types of characters": "Поиск различных классов символов",
"Ranges": "Наборы и диапазоны",
"One of": "любой из:",
"Matches any one of the enclosed characters": "Любой из перечисленных в наборе или диапазоне символов",
"None of": "ни один из:",
"Matches anything that is not enclosed in the brackets": "Любой символ, не перечисленный в наборе или диапазоне",
"Choice": "Альтернация",
"Matches either \"x\" or \"y\"": "Альтернативный выбор — либо «x», либо «y»",
"Quantifier": "Квантификатор",
"Indicate numbers of characters or expressions to match": "Указывает количество повторений символа или выражения",
"Group": "Группа",
"Matches x and remembers the match": "Ищет выражение и запоминает совпадение для последующего обращения по номеру",
"Matches \"x\" but does not remember the match": "Ищет выражение, но не запоминает совпадение",
"Matches \"x\" and stores it on the groups property of the returned matches under the name specified by <Name>": "Ищет выражение и запоминает совпадение для последующего обращения по имени",
"Back reference": "Ссылка",
"A back reference to match group #1": "Обращение к содержимому скобочной группы по номеру",
"A back reference to match group #Name": "Обращение к содержимому скобочной группы по имени",
"Assertion": "Проверки",
"Begins with": "Начало строки",
"Ends with": "Конец строки",
"Matches the beginning of input": "Ищет совпадение в начале строки",
"Matches \"x\" only if \"x\" is followed by \"y\"": "Ищет лишь такое выражение «x», после которого следует «y»",
"Followed by:": "после идёт:",
"Not followed by:": "после не идёт:",
"Preceded by:": "идёт перед:",
"Not preceded by:": "не идёт перед:",
"WordBoundary": "Граница слова",
"NonWordBoundary": "Не граница слова",
"Global search": "Глобальный поиск",
"Case-insensitive": "Игнорировать регистр",
"Multi-line": "Многострочный режим",
"Add A Case": "Добавить случай",
"Insert around": "Вставить узел",
"Group selection": "Ссылка на группу",
"Lookaround assertion": "Проверка до/после",
"Before": "Перед",
"Parallel": "Параллельно",
"After": "После",
"show more": "Дополнительно",
"show less": "Скрыть",
"Expression": "Выражение",
"Content": "Содержимое",
"An Empty Range": "Пустой диапазон",
"Capturing group": "Захватывающая группа",
"Non-capturing group": "Незахватывающая группа",
"Named capturing group": "Именованная группа",
"Capturing": "По номеру",
"Non-cap": "Нет",
"Named cap": "По имени",
"Lookahead assertion": "Опережающая",
"Lookbehind assertion": "Ретроспективная",
"Lookahead": "Опережающая",
"Lookbehind": "Ретроспективная",
"Type": "Тип",
"Value": "Значение",
"Simple string": "Cтрока",
"Character class": "Символьный класс",
"Character range": "Диапазон",
"Beginning Assertion": "Начало строки",
"End Assertion": "Конец строки",
"Word Boundary Assertion": "Граница слова",
"The input will be escaped automatically.": "Введённая строка экранируется автоматически",
"Negate": "Отрицание",
"negate": "отрицание",
"Any character": "Любой символ",
"Any digit": "Любая цифра",
"Non-digit": "Любая не цифра",
"Any alphanumeric": "Любой из [a-zA-Z0-9_]",
"Non-alphanumeric": "Любой кроме [a-zA-Z0-9_]",
"White space": "Любой пробельный символ",
"Non-white space": "Любой непробельный символ",
"Horizontal tab": "Табуляция",
"Carriage return": "Возврат каретки",
"Linefeed": "Новая строка",
"Vertical tab": "Вертикальная табуляция",
"Form-feed": "Перевод страницы",
"Backspace": "Возврат назад",
"NUL": "Символ NUL",
"\\b Backspace": "\\b Возврат назад",
"\\t Horizontal Tab": "\\t Табуляция",
"\\n Line Feed": "\\n Новая строка",
"\\v Vertical Tab": "\\v Вертикальная табуляция",
"\\f Form Feed": "\\f Перевод страницы",
"\\r Carriage Return": "\\r Возврат каретки",
"ASCII symbol": "Символ ASCII",
"Unicode symbol": "Символ Unicode",
"Class": "Класс",
"Back Reference": "Ссылка",
"Choose one": "Выбрать",
"UnGroup": "Разгруппировать",
"Cancel assertion": "Удалить проверку",
"times": "Количество повторов",
"custom": "диапазон",
"1 (default)": "1 (по умолчанию)",
"0 or 1": "0 или 1",
"0 or more": "0 или более",
"1 or more": "1 или более",
"greedy": "Жадный поиск",
"1. Whole Numbers": "1. Неотрицательные целые числа",
"2. Decimal Numbers": "2. Неотрицательные действительные числа",
"3. Whole + Decimal Numbers": "3. Неотрицательные целые и действительные числа",
"4. Negative, Positive Whole + Decimal Numbers": "4. Действительные числа",
"6. Date Format YYYY-MM-dd": "6. Дата в формате YYYY-MM-dd",
"Flag: ": "Флаги: ",
"Allows . to match newline": "Считать . символом перевода строки",
"Settings: ": "Настройки: ",
"include escape ": "добавить экранирование ",
"Copy permalink": "Скопировать ссылку",
"Permalink copied.": "Ссылка скопирована",
"Empty": "Пустой узел",
"Group's name": "Имя группы"
}
1 change: 1 addition & 0 deletions src/components/language-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function LanguageSelect() {
<SelectGroup>
<SelectItem value="en" className="text-xs">English</SelectItem>
<SelectItem value="cn" className="text-xs">简体中文</SelectItem>
<SelectItem value="ru" className="text-xs">Русский</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/editor/features/insert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Insert: React.FC<Props> = ({ nodes }) => {
}
return [
{ value: 'lookahead', label: 'Lookahead' },
{ value: 'lookbehind', label: 'Lookahead' },
{ value: 'lookbehind', label: 'Lookbehind' },
]
}, [nodes])

Expand Down
4 changes: 2 additions & 2 deletions src/modules/editor/legends.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const legends = [
name: 'Choice',
infos: [
{
Icon: <SimpleGraph regex="a|b" />,
Icon: <SimpleGraph regex="x|y" />,
desc: `Matches either "x" or "y"`,
},
],
Expand Down Expand Up @@ -75,7 +75,7 @@ const legends = [
desc: 'A back reference to match group #1',
},
{
Icon: <SimpleGraph regex={'\\k<name>'} />,
Icon: <SimpleGraph regex={'\\k<Name>'} />,
desc: `A back reference to match group #Name`,
},
],
Expand Down
6 changes: 3 additions & 3 deletions src/modules/graph/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ type Props = {
}

const assertionTextMap = {
beginning: 'Begin with',
end: 'End with',
beginning: 'Begins with',
end: 'Ends with',
lookahead: ['Followed by:', 'Not followed by:'],
lookbehind: ['Preceded by:', 'Not Preceded by:'],
lookbehind: ['Preceded by:', 'Not preceded by:'],
word: ['WordBoundary', 'NonWordBoundary'],
}

Expand Down
8 changes: 4 additions & 4 deletions src/modules/graph/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import type { AST, CharacterClassKey } from '@/parser'
import { characterClassTextMap } from '@/parser'

const assertionTextMap = {
beginning: 'Begin with',
end: 'End with',
lookahead: ['Followed by:', 'Not followed by'],
lookbehind: ['Preceded by', 'Not Preceded by'],
beginning: 'Begins with',
end: 'Ends with',
lookahead: ['Followed by:', 'Not followed by:'],
lookbehind: ['Preceded by:', 'Not preceded by:'],
word: ['WordBoundary', 'NonWordBoundary'],
}

Expand Down
4 changes: 2 additions & 2 deletions src/parser/character-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const characterClassTextMap = {
'\\cK': '\\v Vertical Tab',
'\\cL': '\\f Form Feed',
'\\cM': '\\r Carriage Return',
'\\xhh': '',
'\\uhhhh': '',
'\\xhh': 'ASCII symbol',
'\\uhhhh': 'Unicode symbol',
}
export type CharacterClassKey = keyof typeof characterClassTextMap