Skip to content

Commit 3181c64

Browse files
author
lunarych
committed
feature: 前端国际化
1 parent 0cc872b commit 3181c64

File tree

61 files changed

+1405
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1405
-329
lines changed

web/apps/labelstudio/src/app/App.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { LSQueryClient } from "../utils/query-client";
2525
import { RootPage } from "./RootPage";
2626
import "@humansignal/ui/src/tailwind.css";
2727
import "./App.scss";
28+
import "./i18n";
2829

2930
const baseURL = new URL(APP_SETTINGS.hostname || location.origin);
3031
export const UNBLOCK_HISTORY_MESSAGE = "UNBLOCK_HISTORY";
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
3+
*/
4+
import i18n from "i18next";
5+
import { initReactI18next } from "react-i18next";
6+
import en from "../assets/i18n/en-us/common.json";
7+
import zh from "../assets/i18n/zh-cn/common.json";
8+
9+
const resources = {
10+
en: { translation: en },
11+
zh: { translation: zh }
12+
};
13+
i18n.use(initReactI18next).init({
14+
resources,
15+
fallbackLng: "zh_cn",
16+
interpolation: {
17+
escapeValue: false
18+
},
19+
returnNull: false
20+
});
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
{
2+
"Home": "Home",
3+
"Projects": "Projects",
4+
"People": "People",
5+
"General": "General",
6+
"Labeling Interface": "Labeling Interface",
7+
"Annotation": "Annotation",
8+
"Model": "Model",
9+
"Predictions": "Predictions",
10+
"Cloud Storage": "Cloud Storage",
11+
"Webhooks": "Webhooks",
12+
"Danger Zone": "Danger Zone",
13+
14+
"common_title_home": "Home",
15+
"common_title_my account": "Account",
16+
"common_title_projects": "Projects",
17+
"common_title_settings": "Settings",
18+
"common_title_welcome": "welcome",
19+
"common_title_resources": "Resources",
20+
"common_title_documentation": "Documentation",
21+
"common_title_create_project": "Create Project",
22+
"common_title_api_documentation": "API Documentation",
23+
"common_title_release_notes": "Release Notes",
24+
"common_title_label_stud.io_blog": "LabelStud.io Blog",
25+
"common_title_slack_community": "Slack Community",
26+
"common_title_recent_projects": "Recent Projects",
27+
"common_title_create_first_project": "Create your first project",
28+
"common_title_description": "Description",
29+
"common_title_workspace": "Workspace",
30+
"common_title_configure_data": "Configure data",
31+
"common_title_add_label_names": "Add label names",
32+
"common_title_add_choices": "Add choices",
33+
"common_title_choices": "Choices",
34+
"common_title_labels": "Labels",
35+
"common_title_configure_settings": "Configure settings",
36+
"common_title_ui_preview": "UI Preview",
37+
"common_title_invite_people": "Invite people",
38+
"common_title_general_settings": "General Settings",
39+
"common_title_color": "Color",
40+
"common_title_task_Sampling": "Task Sampling",
41+
"common_title_annotation_settings": "Annotation Settings",
42+
"common_title_labeling_instructions": "Labeling Instructions",
43+
"common_title_prelabeling": "Prelabeling",
44+
"common_title_organization": "Organization",
45+
"common_title_people": "People",
46+
"common_title_api_token_setting": "API Tokens Settings",
47+
"common_title_personal_info": "Personal Info",
48+
"common_title_email_preference": "Email Preference",
49+
"common_title_menbership_info": "Membership Info",
50+
"common_title_personal_access_token": "Personal Access Token",
51+
"common_title_legacy_token": "Legacy Token",
52+
"common_title_access_token": "Access Token",
53+
"common_title_general": "General",
54+
"common_title_annotation": "Annotation",
55+
"common_title_model": "Model",
56+
"common_title_predictions": "Predictions",
57+
"common_title_cloud storage": "Cloud Storage",
58+
"common_title_webhooks": "Webhooks",
59+
"common_title_danger zone": "Danger Zone",
60+
"common_title_labeling_interface": "Labeling Interface",
61+
"common_title_import_data": "Import Data",
62+
63+
"common_subtitle_get_started_tip": "Let's get you started.",
64+
"common_subtitle_import_data_first": "Import your data and set up the labeling interface to start annotating",
65+
"common_subtitle_resources_description": "Learn, explore and get help",
66+
"common_subtitle_add_multiple_labels_tip": "Use new line as a separator to add multiple labels",
67+
"common_subtitle_labeling_instruction_tip1":"Write instructions to help users complete labeling tasks.",
68+
"common_subtitle_labeling_instruction_tip2":"The instruction field supports HTML markup and it allows use of images, iframes (pdf).",
69+
70+
"common_button_label": "Label",
71+
"common_button_browse_templates": "Browse Template",
72+
"common_button_view_all": "View All",
73+
"common_button_create_project": "Create Project",
74+
"common_button_project_name": "Project Name",
75+
"common_button_data_import": "Data Import",
76+
"common_button_labeling_setup": "Labeling Setup",
77+
"common_button_invite_people": "Invite People",
78+
"common_button_delete": "Delete",
79+
"common_button_save": "Save",
80+
"common_button_cancel": "Cancel",
81+
"common_button_add": "Add",
82+
"common_button_close": "Close",
83+
"common_button_learn_more": "Learn more",
84+
"common_button_add_url": "Add URL",
85+
"common_button_upload_more_file": "Upload {{more}} Files",
86+
"common_button_more": "More ",
87+
"common_button_limitations": "limitations",
88+
"common_button_cloud_storage": "Cloud Storage",
89+
"common_button_reset_link": "Reset Link",
90+
"common_button_copied": "Copied!",
91+
"common_button_copy_link": "Copy Link",
92+
"common_button_create": "Create",
93+
"common_button_actions": "Actions",
94+
"common_button_columns": "Columns",
95+
"common_button_filters": "Filters",
96+
"common_button_order_by": "Order by",
97+
"common_button_add_filter": "Add Filter",
98+
"common_button_no_filters_applied": "No filters applied",
99+
"common_button_import": "Import",
100+
"common_button_export": "Export",
101+
"common_button_add_people": "Add People",
102+
"common_button_upload_image": "Upload Image",
103+
"common_button_create_new_token": "Create New Token",
104+
"common_button_revoke": "Revoke",
105+
"common_button_back_to_project": "Back to projects",
106+
"common_button_discard_and_leave": "Discard and leave",
107+
"common_button_save_and_leave": "Save and Leave",
108+
109+
"common_tip_load_project_error": "can't load projects",
110+
"common_tip_project_management": "Simplify project management by organizing projects into workspaces.",
111+
"common_tip_saving": "Saving...",
112+
"common_tip_save": "Save",
113+
"common_tip_configure_label": "Configure the labeling interface with tags.",
114+
"common_tip_see_all_availabel_tags":"See all available tags",
115+
"common_tip_template_require_data": "This template requires more data then you have for now",
116+
"common_tip_select_field_label_data": " To select which field(s) to label you need to upload the data.\nAlternatively, you can provide it using Code mode.",
117+
"common_tip_for_invite_people": "Invite people to join your Label Studio instance. People that you invite have full access to all of your projects.",
118+
"common_tip_for_prelabeling": "Enable and select which set of predictions to use for prelabeling.",
119+
"common_tip_for_api_token_saved": "API Token settings saved",
120+
"common_tip_for_check_new_notification": "Please check new notification settings in the Account & Settings page",
121+
122+
"common_placeholder_project_description": "Optional description of your project",
123+
"common_placeholder_select_a_option": "Select an option",
124+
"common_placeholder_dataset_url": "Dataset URL",
125+
"common_placeholder_no_model_or_predictions_available": "No Model or predictions availabel",
126+
"common_placehoder_loading": "Loading ...",
127+
"common_placeholder_please_select_model_or_predictions": "Please select model or predictions",
128+
129+
"common_label_or": "or",
130+
"common_label_treat_csv/tsv_as": "Treat CSV/TSV as",
131+
"common_label_list_of_task": "List of tasks",
132+
"common_label_time_series_or_while_text_file": "Time Series or Whole Text File",
133+
"common_label_drag&drop_files_here": "Drag & drop files here",
134+
"common_label_click_to_browse": "or click to browse",
135+
"common_label_text": "Text",
136+
"common_label_audio": "Audio",
137+
"common_label_video": "Video",
138+
"common_label_video_support_format": "mpeg4/H.264 webp, webm*",
139+
"common_label_images": "Images",
140+
"common_label_html": "HTML",
141+
"common_label_time_series": "Time Series",
142+
"common_label_common_formats": "Common Formats",
143+
"common_label_support_depends_on_the_browser": "* – Support depends on the browser",
144+
"common_label_direct_media_uploads":"* – Direct media uploads have",
145+
"common_label_strongly_recommend_using": "and we strongly recommend using",
146+
"common_label_instead": "instead",
147+
"common_label_code": "Code",
148+
"common_label_visual": "Visual",
149+
"common_label_saved": "Saved!",
150+
"common_label_pan_image": "Pan Image",
151+
"common_label_zoom_in": "Zoom In",
152+
"common_label_zoom_to_fit": "Zoom to fit",
153+
"common_label_zoom_to_actual_size": "Zoom to actual size",
154+
"common_label_zoom_out": "Zoom Out",
155+
"common_label_data": "data",
156+
"common_label_default": "Default",
157+
"common_label_account_settings": "Account & Settings",
158+
"common_label_log_out": "Log Out",
159+
"common_label_per_page": "per page",
160+
"common_label_rename": "Rename",
161+
"common_label_duplicate": "Duplicate",
162+
"common_label_uncertainty_sampling": "Uncertainty sampling",
163+
"common_label_sampling": "sampling",
164+
"common_label_sequential": "Sequential ",
165+
"common_label_random": "Random ",
166+
"common_label_show_before_labeling": "Show before labeling",
167+
"common_label_use_predictions_to_prelabel_tasks": "Use predictions to prelabel tasks",
168+
"common_label_personal_access_tokens": "Personal Access Tokens",
169+
"common_label_legacy_tokens": "Legacy Tokens",
170+
"common_label_time_to_live": "Time-to-Live (optional, Personal Access Token only)",
171+
"common_label_email": "Email",
172+
"common_label_name": "Name",
173+
"common_label_last_activity": "Last Activity",
174+
"common_label_custom_template": "Custom template",
175+
"common_label_first_name": "First Name",
176+
"common_label_last_name": "Last Name",
177+
"common_label_phone": "Phone",
178+
"common_label_user_id": "User ID",
179+
"common_label_registration_date": "Registration date",
180+
"common_label_annotations_submitted": "Annotations Submitted",
181+
"common_label_projects_contributed_to": "Projects contributed to",
182+
"common_label_organization": "Organization",
183+
"common_label_my_role": "My role",
184+
"common_label_organization_id": "Organization ID",
185+
"common_label_owner": "Owner",
186+
"common_label_created": "Created",
187+
"common_label_see": "See",
188+
"common_label_docs": "Docs",
189+
"common_label_regions": "Regions",
190+
"common_label_history": "History",
191+
"common_label_relations": "Relations",
192+
"common_label_comments": "Comments",
193+
"common_label_info": "Info",
194+
"common_label_manual": "Manual",
195+
"common_label_by_time": "By Time",
196+
"common_label_by_score": "By Score",
197+
"common_label_order_by_score": "Order by Score",
198+
"common_label_order_by_time": "Order by Time",
199+
"common_label_regions_not_added": "Regions not added",
200+
"common_label_manual_grouping": "Manual Grouping",
201+
"common_label_manually_grouped": "Manually Grouped",
202+
"common_label_group_manually": "Group Manually",
203+
"common_label_group_by_label": "Group by Label",
204+
"common_label_by_label": "By Label",
205+
"common_label_grouped_by_label": "Grouped by Label",
206+
"common_label_group_by_tool": "Group by Tool",
207+
"common_label_by_tool": "Group by Tool",
208+
"common_label_grouped_by_tool": "Grouped by Tool",
209+
"common_label_annotation_history": "Annotation History",
210+
"common_label_selection_details": "Selection Details",
211+
"common_label_instructions": "Instructions",
212+
"common_label_pin_menu": "Pin menu",
213+
"common_label_unpin_menu": "Unpin menu",
214+
"common_label_list_view": "List view",
215+
"common_label_grid_view": "Grid view",
216+
"common_label_tasks": "Tasks",
217+
"common_label_annotations": "Annotations",
218+
"common_label_width_of_region_borders": "Width of region borders",
219+
"common_label_allow_image_zoom": "Allow image zoom",
220+
"common_label_show_zoom_in_out": "Show controls to zoom in and out",
221+
"common_label_show_rotate_image": "Show controls to rotate image",
222+
"common_label_select_text_by_words": "Select text by words",
223+
"common_label_move": "Move",
224+
"common_label_files_uploaded": "files uploaded",
225+
226+
"common_description_for_personal_access_tokens": "Enable increased token authentication security",
227+
"common_description_for_legacy_tokens": "Enable legacy access tokens, these do not expire",
228+
"common_description_for_time_to_live": "The number of days, after creation, that the token will be valid for. After this time period a user will need to create a new access token",
229+
"common_description_for_all_regions_hidden": "All regions hidden",
230+
"common_description_for_filters_description": "Adjust or remove the filters to view",
231+
"common_description_for_project_not_created": "Project was deleted or not yet created",
232+
"common_description_for_unsaved_title": "You have unsaved changes.",
233+
"common_description_for_unsaved_content": "Would you like to save them before leaving?",
234+
235+
"common_caption_for_project_workspace": "Simplify project management by organizing projects into workspaces.",
236+
"common_caption_for_uncertainty_sampling": "Tasks are chosen according to model uncertainty score (active learning mode)",
237+
"common_caption_for_select_predictions": "Select which predictions or which model you want to use:",
238+
"common_caption_for_invite_people": "Invite people to join your Label Studio instance. People that you invite have full access to all of your projects.",
239+
"common_caption_for_subscribe_info": "Subscribe to HumanSignal news and tips from Heidi",
240+
"common_caption_for_authenticate_api": "Authenticate with our API using your personal access token."
241+
}

0 commit comments

Comments
 (0)