@object-ui/i18n 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/LICENSE +21 -0
  3. package/dist/i18n.d.ts +36 -0
  4. package/dist/i18n.js +62 -0
  5. package/dist/index.d.ts +46 -0
  6. package/dist/index.js +50 -0
  7. package/dist/locales/ar.d.ts +112 -0
  8. package/dist/locales/ar.js +112 -0
  9. package/dist/locales/de.d.ts +111 -0
  10. package/dist/locales/de.js +111 -0
  11. package/dist/locales/en.d.ts +112 -0
  12. package/dist/locales/en.js +111 -0
  13. package/dist/locales/es.d.ts +111 -0
  14. package/dist/locales/es.js +111 -0
  15. package/dist/locales/fr.d.ts +111 -0
  16. package/dist/locales/fr.js +111 -0
  17. package/dist/locales/index.d.ts +1094 -0
  18. package/dist/locales/index.js +38 -0
  19. package/dist/locales/ja.d.ts +111 -0
  20. package/dist/locales/ja.js +111 -0
  21. package/dist/locales/ko.d.ts +111 -0
  22. package/dist/locales/ko.js +111 -0
  23. package/dist/locales/pt.d.ts +111 -0
  24. package/dist/locales/pt.js +111 -0
  25. package/dist/locales/ru.d.ts +111 -0
  26. package/dist/locales/ru.js +111 -0
  27. package/dist/locales/zh.d.ts +111 -0
  28. package/dist/locales/zh.js +111 -0
  29. package/dist/provider.d.ts +65 -0
  30. package/dist/provider.js +84 -0
  31. package/dist/utils/formatting.d.ts +45 -0
  32. package/dist/utils/formatting.js +86 -0
  33. package/dist/utils/index.d.ts +1 -0
  34. package/dist/utils/index.js +1 -0
  35. package/package.json +48 -0
  36. package/src/__tests__/i18n.test.ts +228 -0
  37. package/src/i18n.ts +98 -0
  38. package/src/index.ts +63 -0
  39. package/src/locales/ar.ts +113 -0
  40. package/src/locales/de.ts +112 -0
  41. package/src/locales/en.ts +113 -0
  42. package/src/locales/es.ts +112 -0
  43. package/src/locales/fr.ts +112 -0
  44. package/src/locales/index.ts +42 -0
  45. package/src/locales/ja.ts +112 -0
  46. package/src/locales/ko.ts +112 -0
  47. package/src/locales/pt.ts +112 -0
  48. package/src/locales/ru.ts +112 -0
  49. package/src/locales/zh.ts +112 -0
  50. package/src/provider.tsx +125 -0
  51. package/src/utils/formatting.ts +136 -0
  52. package/src/utils/index.ts +10 -0
  53. package/tsconfig.json +12 -0
  54. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Português (pt) - Portuguese language pack for Object UI
3
+ */
4
+ const pt = {
5
+ common: {
6
+ loading: 'Carregando...',
7
+ save: 'Salvar',
8
+ cancel: 'Cancelar',
9
+ delete: 'Excluir',
10
+ edit: 'Editar',
11
+ create: 'Criar',
12
+ search: 'Pesquisar',
13
+ filter: 'Filtrar',
14
+ reset: 'Redefinir',
15
+ confirm: 'Confirmar',
16
+ close: 'Fechar',
17
+ back: 'Voltar',
18
+ next: 'Próximo',
19
+ previous: 'Anterior',
20
+ submit: 'Enviar',
21
+ refresh: 'Atualizar',
22
+ export: 'Exportar',
23
+ import: 'Importar',
24
+ yes: 'Sim',
25
+ no: 'Não',
26
+ ok: 'OK',
27
+ actions: 'Ações',
28
+ more: 'Mais',
29
+ selectAll: 'Selecionar tudo',
30
+ clearAll: 'Limpar tudo',
31
+ noData: 'Sem dados',
32
+ noResults: 'Nenhum resultado encontrado',
33
+ required: 'Obrigatório',
34
+ optional: 'Opcional',
35
+ },
36
+ validation: {
37
+ required: '{{field}} é obrigatório',
38
+ minLength: '{{field}} deve ter pelo menos {{min}} caracteres',
39
+ maxLength: '{{field}} deve ter no máximo {{max}} caracteres',
40
+ min: '{{field}} deve ser pelo menos {{min}}',
41
+ max: '{{field}} deve ser no máximo {{max}}',
42
+ email: 'Por favor, insira um endereço de e-mail válido',
43
+ url: 'Por favor, insira uma URL válida',
44
+ pattern: 'O formato de {{field}} é inválido',
45
+ unique: '{{field}} deve ser único',
46
+ type: '{{field}} deve ser um {{type}} válido',
47
+ },
48
+ form: {
49
+ addItem: 'Adicionar item',
50
+ removeItem: 'Remover item',
51
+ fieldRequired: 'Este campo é obrigatório',
52
+ invalidFormat: 'Formato inválido',
53
+ saveSuccess: 'Salvo com sucesso',
54
+ saveError: 'Falha ao salvar',
55
+ unsavedChanges: 'Você tem alterações não salvas. Tem certeza de que deseja sair?',
56
+ stepOf: 'Etapa {{current}} de {{total}}',
57
+ },
58
+ table: {
59
+ rowsPerPage: 'Linhas por página',
60
+ showing: 'Mostrando {{from}} a {{to}} de {{total}}',
61
+ noRows: 'Nenhuma linha para exibir',
62
+ sortAsc: 'Ordenar crescente',
63
+ sortDesc: 'Ordenar decrescente',
64
+ filterColumn: 'Filtrar {{column}}',
65
+ columns: 'Colunas',
66
+ exportCSV: 'Exportar CSV',
67
+ exportExcel: 'Exportar Excel',
68
+ selectRow: 'Selecionar linha',
69
+ selectAllRows: 'Selecionar todas as linhas',
70
+ expandRow: 'Expandir linha',
71
+ collapseRow: 'Recolher linha',
72
+ },
73
+ calendar: {
74
+ today: 'Hoje',
75
+ month: 'Mês',
76
+ week: 'Semana',
77
+ day: 'Dia',
78
+ agenda: 'Agenda',
79
+ allDay: 'Dia inteiro',
80
+ noEvents: 'Sem eventos',
81
+ newEvent: 'Novo evento',
82
+ },
83
+ kanban: {
84
+ addCard: 'Adicionar cartão',
85
+ addColumn: 'Adicionar coluna',
86
+ moveCard: 'Mover cartão',
87
+ deleteCard: 'Excluir cartão',
88
+ deleteColumn: 'Excluir coluna',
89
+ },
90
+ chart: {
91
+ noData: 'Nenhum dado de gráfico disponível',
92
+ loading: 'Carregando gráfico...',
93
+ },
94
+ dashboard: {
95
+ addWidget: 'Adicionar widget',
96
+ removeWidget: 'Remover widget',
97
+ editLayout: 'Editar layout',
98
+ saveLayout: 'Salvar layout',
99
+ resetLayout: 'Redefinir layout',
100
+ },
101
+ errors: {
102
+ networkError: 'Erro de rede. Por favor, verifique sua conexão.',
103
+ serverError: 'Erro no servidor. Por favor, tente novamente mais tarde.',
104
+ notFound: 'Recurso não encontrado.',
105
+ unauthorized: 'Você não tem permissão para realizar esta ação.',
106
+ forbidden: 'Acesso negado.',
107
+ timeout: 'Tempo limite excedido. Por favor, tente novamente.',
108
+ unknown: 'Ocorreu um erro inesperado.',
109
+ },
110
+ };
111
+ export default pt;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Русский (ru) - Russian language pack for Object UI
3
+ */
4
+ declare const ru: {
5
+ readonly common: {
6
+ readonly loading: "Загрузка...";
7
+ readonly save: "Сохранить";
8
+ readonly cancel: "Отмена";
9
+ readonly delete: "Удалить";
10
+ readonly edit: "Редактировать";
11
+ readonly create: "Создать";
12
+ readonly search: "Поиск";
13
+ readonly filter: "Фильтр";
14
+ readonly reset: "Сбросить";
15
+ readonly confirm: "Подтвердить";
16
+ readonly close: "Закрыть";
17
+ readonly back: "Назад";
18
+ readonly next: "Далее";
19
+ readonly previous: "Назад";
20
+ readonly submit: "Отправить";
21
+ readonly refresh: "Обновить";
22
+ readonly export: "Экспорт";
23
+ readonly import: "Импорт";
24
+ readonly yes: "Да";
25
+ readonly no: "Нет";
26
+ readonly ok: "ОК";
27
+ readonly actions: "Действия";
28
+ readonly more: "Ещё";
29
+ readonly selectAll: "Выбрать все";
30
+ readonly clearAll: "Очистить все";
31
+ readonly noData: "Нет данных";
32
+ readonly noResults: "Результаты не найдены";
33
+ readonly required: "Обязательно";
34
+ readonly optional: "Необязательно";
35
+ };
36
+ readonly validation: {
37
+ readonly required: "Поле {{field}} обязательно для заполнения";
38
+ readonly minLength: "{{field}} должно содержать не менее {{min}} символов";
39
+ readonly maxLength: "{{field}} должно содержать не более {{max}} символов";
40
+ readonly min: "{{field}} должно быть не менее {{min}}";
41
+ readonly max: "{{field}} должно быть не более {{max}}";
42
+ readonly email: "Пожалуйста, введите корректный адрес электронной почты";
43
+ readonly url: "Пожалуйста, введите корректный URL";
44
+ readonly pattern: "Неверный формат поля {{field}}";
45
+ readonly unique: "{{field}} должно быть уникальным";
46
+ readonly type: "{{field}} должно быть допустимым {{type}}";
47
+ };
48
+ readonly form: {
49
+ readonly addItem: "Добавить элемент";
50
+ readonly removeItem: "Удалить элемент";
51
+ readonly fieldRequired: "Это поле обязательно";
52
+ readonly invalidFormat: "Неверный формат";
53
+ readonly saveSuccess: "Успешно сохранено";
54
+ readonly saveError: "Ошибка сохранения";
55
+ readonly unsavedChanges: "У вас есть несохранённые изменения. Вы уверены, что хотите покинуть страницу?";
56
+ readonly stepOf: "Шаг {{current}} из {{total}}";
57
+ };
58
+ readonly table: {
59
+ readonly rowsPerPage: "Строк на странице";
60
+ readonly showing: "Показано с {{from}} по {{to}} из {{total}}";
61
+ readonly noRows: "Нет строк для отображения";
62
+ readonly sortAsc: "Сортировка по возрастанию";
63
+ readonly sortDesc: "Сортировка по убыванию";
64
+ readonly filterColumn: "Фильтр по {{column}}";
65
+ readonly columns: "Столбцы";
66
+ readonly exportCSV: "Экспорт в CSV";
67
+ readonly exportExcel: "Экспорт в Excel";
68
+ readonly selectRow: "Выбрать строку";
69
+ readonly selectAllRows: "Выбрать все строки";
70
+ readonly expandRow: "Развернуть строку";
71
+ readonly collapseRow: "Свернуть строку";
72
+ };
73
+ readonly calendar: {
74
+ readonly today: "Сегодня";
75
+ readonly month: "Месяц";
76
+ readonly week: "Неделя";
77
+ readonly day: "День";
78
+ readonly agenda: "Расписание";
79
+ readonly allDay: "Весь день";
80
+ readonly noEvents: "Нет событий";
81
+ readonly newEvent: "Новое событие";
82
+ };
83
+ readonly kanban: {
84
+ readonly addCard: "Добавить карточку";
85
+ readonly addColumn: "Добавить колонку";
86
+ readonly moveCard: "Переместить карточку";
87
+ readonly deleteCard: "Удалить карточку";
88
+ readonly deleteColumn: "Удалить колонку";
89
+ };
90
+ readonly chart: {
91
+ readonly noData: "Нет данных для графика";
92
+ readonly loading: "Загрузка графика...";
93
+ };
94
+ readonly dashboard: {
95
+ readonly addWidget: "Добавить виджет";
96
+ readonly removeWidget: "Удалить виджет";
97
+ readonly editLayout: "Редактировать макет";
98
+ readonly saveLayout: "Сохранить макет";
99
+ readonly resetLayout: "Сбросить макет";
100
+ };
101
+ readonly errors: {
102
+ readonly networkError: "Ошибка сети. Проверьте подключение к интернету.";
103
+ readonly serverError: "Ошибка сервера. Попробуйте позже.";
104
+ readonly notFound: "Ресурс не найден.";
105
+ readonly unauthorized: "У вас нет прав для выполнения этого действия.";
106
+ readonly forbidden: "Доступ запрещён.";
107
+ readonly timeout: "Время ожидания истекло. Попробуйте снова.";
108
+ readonly unknown: "Произошла непредвиденная ошибка.";
109
+ };
110
+ };
111
+ export default ru;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Русский (ru) - Russian language pack for Object UI
3
+ */
4
+ const ru = {
5
+ common: {
6
+ loading: 'Загрузка...',
7
+ save: 'Сохранить',
8
+ cancel: 'Отмена',
9
+ delete: 'Удалить',
10
+ edit: 'Редактировать',
11
+ create: 'Создать',
12
+ search: 'Поиск',
13
+ filter: 'Фильтр',
14
+ reset: 'Сбросить',
15
+ confirm: 'Подтвердить',
16
+ close: 'Закрыть',
17
+ back: 'Назад',
18
+ next: 'Далее',
19
+ previous: 'Назад',
20
+ submit: 'Отправить',
21
+ refresh: 'Обновить',
22
+ export: 'Экспорт',
23
+ import: 'Импорт',
24
+ yes: 'Да',
25
+ no: 'Нет',
26
+ ok: 'ОК',
27
+ actions: 'Действия',
28
+ more: 'Ещё',
29
+ selectAll: 'Выбрать все',
30
+ clearAll: 'Очистить все',
31
+ noData: 'Нет данных',
32
+ noResults: 'Результаты не найдены',
33
+ required: 'Обязательно',
34
+ optional: 'Необязательно',
35
+ },
36
+ validation: {
37
+ required: 'Поле {{field}} обязательно для заполнения',
38
+ minLength: '{{field}} должно содержать не менее {{min}} символов',
39
+ maxLength: '{{field}} должно содержать не более {{max}} символов',
40
+ min: '{{field}} должно быть не менее {{min}}',
41
+ max: '{{field}} должно быть не более {{max}}',
42
+ email: 'Пожалуйста, введите корректный адрес электронной почты',
43
+ url: 'Пожалуйста, введите корректный URL',
44
+ pattern: 'Неверный формат поля {{field}}',
45
+ unique: '{{field}} должно быть уникальным',
46
+ type: '{{field}} должно быть допустимым {{type}}',
47
+ },
48
+ form: {
49
+ addItem: 'Добавить элемент',
50
+ removeItem: 'Удалить элемент',
51
+ fieldRequired: 'Это поле обязательно',
52
+ invalidFormat: 'Неверный формат',
53
+ saveSuccess: 'Успешно сохранено',
54
+ saveError: 'Ошибка сохранения',
55
+ unsavedChanges: 'У вас есть несохранённые изменения. Вы уверены, что хотите покинуть страницу?',
56
+ stepOf: 'Шаг {{current}} из {{total}}',
57
+ },
58
+ table: {
59
+ rowsPerPage: 'Строк на странице',
60
+ showing: 'Показано с {{from}} по {{to}} из {{total}}',
61
+ noRows: 'Нет строк для отображения',
62
+ sortAsc: 'Сортировка по возрастанию',
63
+ sortDesc: 'Сортировка по убыванию',
64
+ filterColumn: 'Фильтр по {{column}}',
65
+ columns: 'Столбцы',
66
+ exportCSV: 'Экспорт в CSV',
67
+ exportExcel: 'Экспорт в Excel',
68
+ selectRow: 'Выбрать строку',
69
+ selectAllRows: 'Выбрать все строки',
70
+ expandRow: 'Развернуть строку',
71
+ collapseRow: 'Свернуть строку',
72
+ },
73
+ calendar: {
74
+ today: 'Сегодня',
75
+ month: 'Месяц',
76
+ week: 'Неделя',
77
+ day: 'День',
78
+ agenda: 'Расписание',
79
+ allDay: 'Весь день',
80
+ noEvents: 'Нет событий',
81
+ newEvent: 'Новое событие',
82
+ },
83
+ kanban: {
84
+ addCard: 'Добавить карточку',
85
+ addColumn: 'Добавить колонку',
86
+ moveCard: 'Переместить карточку',
87
+ deleteCard: 'Удалить карточку',
88
+ deleteColumn: 'Удалить колонку',
89
+ },
90
+ chart: {
91
+ noData: 'Нет данных для графика',
92
+ loading: 'Загрузка графика...',
93
+ },
94
+ dashboard: {
95
+ addWidget: 'Добавить виджет',
96
+ removeWidget: 'Удалить виджет',
97
+ editLayout: 'Редактировать макет',
98
+ saveLayout: 'Сохранить макет',
99
+ resetLayout: 'Сбросить макет',
100
+ },
101
+ errors: {
102
+ networkError: 'Ошибка сети. Проверьте подключение к интернету.',
103
+ serverError: 'Ошибка сервера. Попробуйте позже.',
104
+ notFound: 'Ресурс не найден.',
105
+ unauthorized: 'У вас нет прав для выполнения этого действия.',
106
+ forbidden: 'Доступ запрещён.',
107
+ timeout: 'Время ожидания истекло. Попробуйте снова.',
108
+ unknown: 'Произошла непредвиденная ошибка.',
109
+ },
110
+ };
111
+ export default ru;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * 中文 (zh) - Chinese language pack for Object UI
3
+ */
4
+ declare const zh: {
5
+ readonly common: {
6
+ readonly loading: "加载中...";
7
+ readonly save: "保存";
8
+ readonly cancel: "取消";
9
+ readonly delete: "删除";
10
+ readonly edit: "编辑";
11
+ readonly create: "新建";
12
+ readonly search: "搜索";
13
+ readonly filter: "筛选";
14
+ readonly reset: "重置";
15
+ readonly confirm: "确认";
16
+ readonly close: "关闭";
17
+ readonly back: "返回";
18
+ readonly next: "下一步";
19
+ readonly previous: "上一步";
20
+ readonly submit: "提交";
21
+ readonly refresh: "刷新";
22
+ readonly export: "导出";
23
+ readonly import: "导入";
24
+ readonly yes: "是";
25
+ readonly no: "否";
26
+ readonly ok: "确定";
27
+ readonly actions: "操作";
28
+ readonly more: "更多";
29
+ readonly selectAll: "全选";
30
+ readonly clearAll: "清除全部";
31
+ readonly noData: "暂无数据";
32
+ readonly noResults: "未找到结果";
33
+ readonly required: "必填";
34
+ readonly optional: "选填";
35
+ };
36
+ readonly validation: {
37
+ readonly required: "{{field}}不能为空";
38
+ readonly minLength: "{{field}}至少需要{{min}}个字符";
39
+ readonly maxLength: "{{field}}最多{{max}}个字符";
40
+ readonly min: "{{field}}不能小于{{min}}";
41
+ readonly max: "{{field}}不能大于{{max}}";
42
+ readonly email: "请输入有效的邮箱地址";
43
+ readonly url: "请输入有效的URL";
44
+ readonly pattern: "{{field}}格式不正确";
45
+ readonly unique: "{{field}}必须唯一";
46
+ readonly type: "{{field}}必须是有效的{{type}}";
47
+ };
48
+ readonly form: {
49
+ readonly addItem: "添加项目";
50
+ readonly removeItem: "移除项目";
51
+ readonly fieldRequired: "此字段为必填项";
52
+ readonly invalidFormat: "格式不正确";
53
+ readonly saveSuccess: "保存成功";
54
+ readonly saveError: "保存失败";
55
+ readonly unsavedChanges: "您有未保存的更改,确定要离开吗?";
56
+ readonly stepOf: "第{{current}}步,共{{total}}步";
57
+ };
58
+ readonly table: {
59
+ readonly rowsPerPage: "每页行数";
60
+ readonly showing: "显示第{{from}}到{{to}}条,共{{total}}条";
61
+ readonly noRows: "暂无数据";
62
+ readonly sortAsc: "升序排列";
63
+ readonly sortDesc: "降序排列";
64
+ readonly filterColumn: "筛选{{column}}";
65
+ readonly columns: "列";
66
+ readonly exportCSV: "导出CSV";
67
+ readonly exportExcel: "导出Excel";
68
+ readonly selectRow: "选择行";
69
+ readonly selectAllRows: "选择所有行";
70
+ readonly expandRow: "展开行";
71
+ readonly collapseRow: "折叠行";
72
+ };
73
+ readonly calendar: {
74
+ readonly today: "今天";
75
+ readonly month: "月";
76
+ readonly week: "周";
77
+ readonly day: "日";
78
+ readonly agenda: "日程";
79
+ readonly allDay: "全天";
80
+ readonly noEvents: "暂无事件";
81
+ readonly newEvent: "新建事件";
82
+ };
83
+ readonly kanban: {
84
+ readonly addCard: "添加卡片";
85
+ readonly addColumn: "添加列";
86
+ readonly moveCard: "移动卡片";
87
+ readonly deleteCard: "删除卡片";
88
+ readonly deleteColumn: "删除列";
89
+ };
90
+ readonly chart: {
91
+ readonly noData: "暂无图表数据";
92
+ readonly loading: "图表加载中...";
93
+ };
94
+ readonly dashboard: {
95
+ readonly addWidget: "添加组件";
96
+ readonly removeWidget: "移除组件";
97
+ readonly editLayout: "编辑布局";
98
+ readonly saveLayout: "保存布局";
99
+ readonly resetLayout: "重置布局";
100
+ };
101
+ readonly errors: {
102
+ readonly networkError: "网络错误,请检查网络连接。";
103
+ readonly serverError: "服务器错误,请稍后重试。";
104
+ readonly notFound: "资源未找到。";
105
+ readonly unauthorized: "您没有权限执行此操作。";
106
+ readonly forbidden: "访问被拒绝。";
107
+ readonly timeout: "请求超时,请重试。";
108
+ readonly unknown: "发生未知错误。";
109
+ };
110
+ };
111
+ export default zh;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * 中文 (zh) - Chinese language pack for Object UI
3
+ */
4
+ const zh = {
5
+ common: {
6
+ loading: '加载中...',
7
+ save: '保存',
8
+ cancel: '取消',
9
+ delete: '删除',
10
+ edit: '编辑',
11
+ create: '新建',
12
+ search: '搜索',
13
+ filter: '筛选',
14
+ reset: '重置',
15
+ confirm: '确认',
16
+ close: '关闭',
17
+ back: '返回',
18
+ next: '下一步',
19
+ previous: '上一步',
20
+ submit: '提交',
21
+ refresh: '刷新',
22
+ export: '导出',
23
+ import: '导入',
24
+ yes: '是',
25
+ no: '否',
26
+ ok: '确定',
27
+ actions: '操作',
28
+ more: '更多',
29
+ selectAll: '全选',
30
+ clearAll: '清除全部',
31
+ noData: '暂无数据',
32
+ noResults: '未找到结果',
33
+ required: '必填',
34
+ optional: '选填',
35
+ },
36
+ validation: {
37
+ required: '{{field}}不能为空',
38
+ minLength: '{{field}}至少需要{{min}}个字符',
39
+ maxLength: '{{field}}最多{{max}}个字符',
40
+ min: '{{field}}不能小于{{min}}',
41
+ max: '{{field}}不能大于{{max}}',
42
+ email: '请输入有效的邮箱地址',
43
+ url: '请输入有效的URL',
44
+ pattern: '{{field}}格式不正确',
45
+ unique: '{{field}}必须唯一',
46
+ type: '{{field}}必须是有效的{{type}}',
47
+ },
48
+ form: {
49
+ addItem: '添加项目',
50
+ removeItem: '移除项目',
51
+ fieldRequired: '此字段为必填项',
52
+ invalidFormat: '格式不正确',
53
+ saveSuccess: '保存成功',
54
+ saveError: '保存失败',
55
+ unsavedChanges: '您有未保存的更改,确定要离开吗?',
56
+ stepOf: '第{{current}}步,共{{total}}步',
57
+ },
58
+ table: {
59
+ rowsPerPage: '每页行数',
60
+ showing: '显示第{{from}}到{{to}}条,共{{total}}条',
61
+ noRows: '暂无数据',
62
+ sortAsc: '升序排列',
63
+ sortDesc: '降序排列',
64
+ filterColumn: '筛选{{column}}',
65
+ columns: '列',
66
+ exportCSV: '导出CSV',
67
+ exportExcel: '导出Excel',
68
+ selectRow: '选择行',
69
+ selectAllRows: '选择所有行',
70
+ expandRow: '展开行',
71
+ collapseRow: '折叠行',
72
+ },
73
+ calendar: {
74
+ today: '今天',
75
+ month: '月',
76
+ week: '周',
77
+ day: '日',
78
+ agenda: '日程',
79
+ allDay: '全天',
80
+ noEvents: '暂无事件',
81
+ newEvent: '新建事件',
82
+ },
83
+ kanban: {
84
+ addCard: '添加卡片',
85
+ addColumn: '添加列',
86
+ moveCard: '移动卡片',
87
+ deleteCard: '删除卡片',
88
+ deleteColumn: '删除列',
89
+ },
90
+ chart: {
91
+ noData: '暂无图表数据',
92
+ loading: '图表加载中...',
93
+ },
94
+ dashboard: {
95
+ addWidget: '添加组件',
96
+ removeWidget: '移除组件',
97
+ editLayout: '编辑布局',
98
+ saveLayout: '保存布局',
99
+ resetLayout: '重置布局',
100
+ },
101
+ errors: {
102
+ networkError: '网络错误,请检查网络连接。',
103
+ serverError: '服务器错误,请稍后重试。',
104
+ notFound: '资源未找到。',
105
+ unauthorized: '您没有权限执行此操作。',
106
+ forbidden: '访问被拒绝。',
107
+ timeout: '请求超时,请重试。',
108
+ unknown: '发生未知错误。',
109
+ },
110
+ };
111
+ export default zh;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @object-ui/i18n - React integration
3
+ *
4
+ * Provides I18nProvider and useObjectTranslation hook for React components.
5
+ */
6
+ import React from 'react';
7
+ import type { i18n as I18nInstance } from 'i18next';
8
+ import { type I18nConfig } from './i18n';
9
+ interface I18nContextValue {
10
+ /** Current language code */
11
+ language: string;
12
+ /** Change the active language */
13
+ changeLanguage: (lang: string) => Promise<void>;
14
+ /** Current text direction ('ltr' or 'rtl') */
15
+ direction: 'ltr' | 'rtl';
16
+ /** The underlying i18next instance */
17
+ i18n: I18nInstance;
18
+ }
19
+ export interface I18nProviderProps {
20
+ /** i18n configuration options */
21
+ config?: I18nConfig;
22
+ /** Pre-created i18next instance (overrides config) */
23
+ instance?: I18nInstance;
24
+ /** Children to render */
25
+ children: React.ReactNode;
26
+ }
27
+ /**
28
+ * I18nProvider - Wraps your app with i18n support
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <I18nProvider config={{ defaultLanguage: 'zh' }}>
33
+ * <App />
34
+ * </I18nProvider>
35
+ * ```
36
+ */
37
+ export declare function I18nProvider({ config, instance: externalInstance, children }: I18nProviderProps): React.FunctionComponentElement<React.ProviderProps<I18nContextValue | null>>;
38
+ /**
39
+ * Hook to access Object UI i18n context
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * function MyComponent() {
44
+ * const { t, language, changeLanguage, direction } = useObjectTranslation();
45
+ * return <div dir={direction}>{t('common.save')}</div>;
46
+ * }
47
+ * ```
48
+ */
49
+ export declare function useObjectTranslation(ns?: string): {
50
+ /** Translation function */
51
+ t: import("i18next").TFunction<string, undefined>;
52
+ /** Current language code */
53
+ language: string;
54
+ /** Change the active language */
55
+ changeLanguage: (lang: string) => Promise<void>;
56
+ /** Current text direction */
57
+ direction: "ltr" | "rtl";
58
+ /** The underlying i18next instance */
59
+ i18n: I18nInstance;
60
+ };
61
+ /**
62
+ * Hook to access the i18n context directly
63
+ */
64
+ export declare function useI18nContext(): I18nContextValue;
65
+ export {};