Skip to content

Commit 251c528

Browse files
authored
💬 Semantics with Vietnamese (#166)
1 parent 9e29888 commit 251c528

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
## 3.7.1
8+
9+
### New features
10+
11+
- Add Vietnamese language text delegate. (#166).
12+
713
## 3.7.0
814

915
### New features

lib/src/delegates/camera_picker_text_delegate.dart

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const List<CameraPickerTextDelegate> cameraPickerTextDelegates =
1010
<CameraPickerTextDelegate>[
1111
CameraPickerTextDelegate(),
1212
EnglishCameraPickerTextDelegate(),
13+
VietnameseCameraPickerTextDelegate(),
1314
];
1415

1516
/// Obtain the text delegate from the given locale.
@@ -191,3 +192,99 @@ class EnglishCameraPickerTextDelegate extends CameraPickerTextDelegate {
191192
String sSwitchCameraLensDirectionLabel(CameraLensDirection value) =>
192193
'Switch to the ${sCameraLensDirectionLabel(value)} camera';
193194
}
195+
196+
/// Text delegate implemented with Vietnamese.
197+
/// Dịch tiếng Việt
198+
class VietnameseCameraPickerTextDelegate extends CameraPickerTextDelegate {
199+
const VietnameseCameraPickerTextDelegate();
200+
201+
@override
202+
String get languageCode => 'vi';
203+
204+
@override
205+
String get confirm => 'Xác nhận';
206+
207+
@override
208+
String get shootingTips => 'Chạm để chụp ảnh.';
209+
210+
@override
211+
String get shootingWithRecordingTips =>
212+
'Chạm để chụp ảnh. Giữ để quay video.';
213+
214+
@override
215+
String get shootingOnlyRecordingTips => 'Giữ để quay video.';
216+
217+
@override
218+
String get shootingTapRecordingTips => 'Chạm để quay video.';
219+
220+
@override
221+
String get loadFailed => 'Tải thất bại';
222+
223+
@override
224+
String get loading => 'Đang tải...';
225+
226+
@override
227+
String get saving => 'Đang lưu...';
228+
229+
@override
230+
String get sActionManuallyFocusHint => 'lấy nét bằng tay';
231+
232+
@override
233+
String get sActionPreviewHint => 'xem trước';
234+
235+
@override
236+
String get sActionRecordHint => 'quay';
237+
238+
@override
239+
String get sActionShootHint => 'chụp';
240+
241+
@override
242+
String get sActionShootingButtonTooltip => 'nút chụp';
243+
244+
@override
245+
String get sActionStopRecordingHint => 'dừng quay';
246+
247+
@override
248+
String sCameraLensDirectionLabel(CameraLensDirection value) {
249+
switch (value) {
250+
case CameraLensDirection.front:
251+
return 'trước';
252+
case CameraLensDirection.back:
253+
return 'sau';
254+
case CameraLensDirection.external:
255+
return 'ngoài';
256+
}
257+
}
258+
259+
@override
260+
String? sCameraPreviewLabel(CameraLensDirection? value) {
261+
if (value == null) {
262+
return null;
263+
}
264+
return 'Xem trước camera ${sCameraLensDirectionLabel(value)}';
265+
}
266+
267+
@override
268+
String sFlashModeLabel(FlashMode mode) {
269+
final String modeString;
270+
switch (mode) {
271+
case FlashMode.off:
272+
modeString = 'Tắt';
273+
break;
274+
case FlashMode.auto:
275+
modeString = 'Tự động';
276+
break;
277+
case FlashMode.always:
278+
modeString = 'Luôn bật đèn flash khi chụp ảnh';
279+
break;
280+
case FlashMode.torch:
281+
modeString = 'Luôn bật đèn flash';
282+
break;
283+
}
284+
return 'Chế độ đèn flash: $modeString';
285+
}
286+
287+
@override
288+
String sSwitchCameraLensDirectionLabel(CameraLensDirection value) =>
289+
'Chuyển sang camera ${sCameraLensDirectionLabel(value)}';
290+
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: wechat_camera_picker
22
description: A camera picker based on WeChat's UI which is a separate runnable extension to wechat_assets_picker.
33
repository: https://github.com/fluttercandies/flutter_wechat_camera_picker
4-
version: 3.7.0
4+
version: 3.7.1
55

66
environment:
77
sdk: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)