@umituz/react-native-localization 2.8.0 → 3.0.1

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 (49) hide show
  1. package/package.json +21 -11
  2. package/scripts/prepublish.js +29 -16
  3. package/src/domain/repositories/ILocalizationRepository.ts +2 -2
  4. package/src/index.ts +2 -1
  5. package/src/infrastructure/components/LanguageSwitcher.tsx +90 -37
  6. package/src/infrastructure/components/LocalizationProvider.tsx +115 -7
  7. package/src/infrastructure/components/__tests__/LanguageSwitcher.test.tsx +91 -0
  8. package/src/infrastructure/components/useLanguageNavigation.ts +4 -4
  9. package/src/infrastructure/config/TranslationCache.ts +27 -0
  10. package/src/infrastructure/config/TranslationLoader.ts +4 -8
  11. package/src/infrastructure/config/__tests__/TranslationCache.test.ts +44 -0
  12. package/src/infrastructure/config/__tests__/languagesData.test.ts +49 -0
  13. package/src/infrastructure/config/languages.ts +1 -1
  14. package/src/infrastructure/config/languagesData.ts +91 -61
  15. package/src/infrastructure/hooks/__tests__/useTranslation.test.ts +52 -0
  16. package/src/infrastructure/hooks/useLocalization.ts +58 -0
  17. package/src/infrastructure/hooks/useTranslation.ts +84 -29
  18. package/src/infrastructure/storage/LanguageInitializer.ts +7 -5
  19. package/src/infrastructure/storage/LanguageSwitcher.ts +3 -3
  20. package/src/infrastructure/storage/LocalizationStore.ts +103 -94
  21. package/src/infrastructure/storage/types/LocalizationState.ts +31 -0
  22. package/src/presentation/components/LanguageItem.tsx +109 -0
  23. package/src/presentation/components/SearchInput.tsx +90 -0
  24. package/src/presentation/components/__tests__/LanguageItem.test.tsx +106 -0
  25. package/src/presentation/components/__tests__/SearchInput.test.tsx +95 -0
  26. package/src/presentation/screens/LanguageSelectionScreen.tsx +90 -146
  27. package/src/presentation/screens/__tests__/LanguageSelectionScreen.test.tsx +166 -0
  28. package/src/scripts/prepublish.ts +48 -0
  29. package/src/infrastructure/locales/en-US/alerts.json +0 -107
  30. package/src/infrastructure/locales/en-US/auth.json +0 -34
  31. package/src/infrastructure/locales/en-US/branding.json +0 -8
  32. package/src/infrastructure/locales/en-US/clipboard.json +0 -9
  33. package/src/infrastructure/locales/en-US/common.json +0 -57
  34. package/src/infrastructure/locales/en-US/datetime.json +0 -138
  35. package/src/infrastructure/locales/en-US/device.json +0 -14
  36. package/src/infrastructure/locales/en-US/editor.json +0 -64
  37. package/src/infrastructure/locales/en-US/errors.json +0 -41
  38. package/src/infrastructure/locales/en-US/general.json +0 -57
  39. package/src/infrastructure/locales/en-US/goals.json +0 -5
  40. package/src/infrastructure/locales/en-US/haptics.json +0 -6
  41. package/src/infrastructure/locales/en-US/home.json +0 -62
  42. package/src/infrastructure/locales/en-US/index.ts +0 -54
  43. package/src/infrastructure/locales/en-US/navigation.json +0 -6
  44. package/src/infrastructure/locales/en-US/onboarding.json +0 -26
  45. package/src/infrastructure/locales/en-US/projects.json +0 -34
  46. package/src/infrastructure/locales/en-US/settings.json +0 -45
  47. package/src/infrastructure/locales/en-US/sharing.json +0 -8
  48. package/src/infrastructure/locales/en-US/templates.json +0 -28
  49. package/src/infrastructure/scripts/createLocaleLoaders.js +0 -177
@@ -1,57 +0,0 @@
1
- {
2
- "cancel": "Cancel",
3
- "confirm": "Confirm",
4
- "continue": "Continue",
5
- "delete": "Delete",
6
- "edit": "Edit",
7
- "error": "Error",
8
- "loading": "Loading...",
9
- "notNow": "Not Now",
10
- "ok": "OK",
11
- "optional": "Optional",
12
- "save": "Save",
13
- "somethingWentWrong": "Something went wrong",
14
- "success": "Success",
15
- "close": "Close",
16
- "done": "Done",
17
- "next": "Next",
18
- "previous": "Previous",
19
- "skip": "Skip",
20
- "retry": "Retry",
21
- "refresh": "Refresh",
22
- "filter": "Filter",
23
- "sort": "Sort",
24
- "add": "Add",
25
- "remove": "Remove",
26
- "update": "Update",
27
- "create": "Create",
28
- "view": "View",
29
- "details": "Details",
30
- "share": "Share",
31
- "download": "Download",
32
- "upload": "Upload",
33
- "submit": "Submit",
34
- "reset": "Reset",
35
- "clear": "Clear",
36
- "apply": "Apply",
37
- "yes": "Yes",
38
- "no": "No",
39
- "or": "or",
40
- "all": "All",
41
- "none": "None",
42
- "of": "of",
43
- "select": "Select",
44
- "selected": "Selected",
45
- "required": "Required",
46
- "empty": "Empty",
47
- "noData": "No data available",
48
- "noResults": "No results found",
49
- "tryAgain": "Try again",
50
- "learnMore": "Learn more",
51
- "getStarted": "Get started",
52
- "viewAll": "View all",
53
- "showMore": "Show more",
54
- "showLess": "Show less",
55
- "back": "Back",
56
- "start": "Start"
57
- }
@@ -1,138 +0,0 @@
1
- {
2
- "days": {
3
- "full": {
4
- "monday": "Monday",
5
- "tuesday": "Tuesday",
6
- "wednesday": "Wednesday",
7
- "thursday": "Thursday",
8
- "friday": "Friday",
9
- "saturday": "Saturday",
10
- "sunday": "Sunday"
11
- },
12
- "short": {
13
- "mon": "Mon",
14
- "tue": "Tue",
15
- "wed": "Wed",
16
- "thu": "Thu",
17
- "fri": "Fri",
18
- "sat": "Sat",
19
- "sun": "Sun"
20
- },
21
- "abbreviated": {
22
- "m": "M",
23
- "t": "T",
24
- "w": "W",
25
- "th": "Th",
26
- "f": "F",
27
- "sa": "Sa",
28
- "su": "Su"
29
- }
30
- },
31
- "months": {
32
- "full": {
33
- "january": "January",
34
- "february": "February",
35
- "march": "March",
36
- "april": "April",
37
- "may": "May",
38
- "june": "June",
39
- "july": "July",
40
- "august": "August",
41
- "september": "September",
42
- "october": "October",
43
- "november": "November",
44
- "december": "December"
45
- },
46
- "short": {
47
- "jan": "Jan",
48
- "feb": "Feb",
49
- "mar": "Mar",
50
- "apr": "Apr",
51
- "may": "May",
52
- "jun": "Jun",
53
- "jul": "Jul",
54
- "aug": "Aug",
55
- "sep": "Sep",
56
- "oct": "Oct",
57
- "nov": "Nov",
58
- "dec": "Dec"
59
- }
60
- },
61
- "relative": {
62
- "now": "Now",
63
- "justNow": "Just now",
64
- "yesterday": "Yesterday",
65
- "tomorrow": "Tomorrow",
66
- "thisWeek": "This week",
67
- "lastWeek": "Last week",
68
- "nextWeek": "Next week",
69
- "thisMonth": "This month",
70
- "lastMonth": "Last month",
71
- "nextMonth": "Next month",
72
- "thisYear": "This year",
73
- "lastYear": "Last year",
74
- "nextYear": "Next year",
75
- "ago": "ago",
76
- "fromNow": "from now",
77
- "in": "in"
78
- },
79
- "units": {
80
- "singular": {
81
- "second": "second",
82
- "minute": "minute",
83
- "hour": "hour",
84
- "day": "day",
85
- "week": "week",
86
- "month": "month",
87
- "year": "year"
88
- },
89
- "plural": {
90
- "seconds": "seconds",
91
- "minutes": "minutes",
92
- "hours": "hours",
93
- "days": "days",
94
- "weeks": "weeks",
95
- "months": "months",
96
- "years": "years"
97
- },
98
- "short": {
99
- "s": "s",
100
- "m": "m",
101
- "h": "h",
102
- "d": "d",
103
- "w": "w",
104
- "mo": "mo",
105
- "y": "y"
106
- }
107
- },
108
- "periods": {
109
- "am": "AM",
110
- "pm": "PM",
111
- "morning": "Morning",
112
- "afternoon": "Afternoon",
113
- "evening": "Evening",
114
- "night": "Night",
115
- "midnight": "Midnight",
116
- "noon": "Noon"
117
- },
118
- "formats": {
119
- "date": "Date",
120
- "time": "Time",
121
- "datetime": "Date & Time",
122
- "duration": "Duration",
123
- "startDate": "Start Date",
124
- "endDate": "End Date",
125
- "startTime": "Start Time",
126
- "endTime": "End Time",
127
- "selectDate": "Select Date",
128
- "selectTime": "Select Time"
129
- },
130
- "actions": {
131
- "setDate": "Set Date",
132
- "setTime": "Set Time",
133
- "clearDate": "Clear Date",
134
- "clearTime": "Clear Time",
135
- "confirmDate": "Confirm Date",
136
- "confirmTime": "Confirm Time"
137
- }
138
- }
@@ -1,14 +0,0 @@
1
- {
2
- "device": {
3
- "deviceInfo": "Device Information",
4
- "appInfo": "App Information",
5
- "model": "Model",
6
- "os": "Operating System",
7
- "version": "Version",
8
- "build": "Build",
9
- "memory": "Memory",
10
- "installed": "Installed",
11
- "updated": "Last Updated",
12
- "unknown": "Unknown"
13
- }
14
- }
@@ -1,64 +0,0 @@
1
- {
2
- "screen": {
3
- "title": "Video Editor",
4
- "untitled_project": "Untitled Project"
5
- },
6
- "preview": {
7
- "play": "Play",
8
- "pause": "Pause",
9
- "reset": "Reset"
10
- },
11
- "tools": {
12
- "title": "Tools",
13
- "text": "Text",
14
- "image": "Image",
15
- "shape": "Shape",
16
- "audio": "Audio",
17
- "effects": "Effects"
18
- },
19
- "timeline": {
20
- "title": "Timeline",
21
- "add_scene": "Add Scene",
22
- "duration": "Duration: {{duration}}s",
23
- "scene": "Scene {{number}}"
24
- },
25
- "layers": {
26
- "title": "Layers",
27
- "add_layer": "Add Layer",
28
- "no_layers": "No layers yet",
29
- "text_layer": "Text Layer",
30
- "image_layer": "Image Layer",
31
- "video_layer": "Video Layer",
32
- "shape_layer": "Shape Layer"
33
- },
34
- "properties": {
35
- "title": "Properties",
36
- "position": "Position",
37
- "size": "Size",
38
- "rotation": "Rotation",
39
- "opacity": "Opacity",
40
- "text": "Text",
41
- "font_size": "Font Size",
42
- "font_family": "Font Family",
43
- "color": "Color",
44
- "text_align": "Text Align",
45
- "animation": "Animation"
46
- },
47
- "export": {
48
- "title": "Export Video",
49
- "resolution": "Resolution",
50
- "quality": "Quality",
51
- "format": "Format",
52
- "exporting": "Exporting...",
53
- "success": "Video exported successfully!",
54
- "error": "Failed to export video"
55
- },
56
- "actions": {
57
- "save": "Save",
58
- "export": "Export",
59
- "undo": "Undo",
60
- "redo": "Redo",
61
- "delete": "Delete",
62
- "duplicate": "Duplicate"
63
- }
64
- }
@@ -1,41 +0,0 @@
1
- {
2
- "validation": {
3
- "required": "This field is required",
4
- "invalidEmail": "Invalid email format",
5
- "invalidPhone": "Invalid phone number",
6
- "invalidUrl": "Invalid URL format",
7
- "minLength": "Minimum length is {{min}} characters",
8
- "maxLength": "Maximum length is {{max}} characters",
9
- "minValue": "Minimum value is {{min}}",
10
- "maxValue": "Maximum value is {{max}}",
11
- "mustMatch": "Fields must match",
12
- "invalidFormat": "Invalid format",
13
- "invalidDate": "Invalid date",
14
- "futureDate": "Date must be in the future",
15
- "pastDate": "Date must be in the past"
16
- },
17
- "storage": {
18
- "saveFailed": "Failed to save data",
19
- "loadFailed": "Failed to load data",
20
- "deleteFailed": "Failed to delete data",
21
- "notFound": "Data not found"
22
- },
23
- "permission": {
24
- "denied": "Permission denied",
25
- "notGranted": "Permission not granted",
26
- "cameraNotAvailable": "Camera not available",
27
- "locationNotAvailable": "Location services not available",
28
- "microphoneNotAvailable": "Microphone not available",
29
- "photosNotAvailable": "Photo library not available"
30
- },
31
- "common": {
32
- "tryAgainLater": "Please try again later",
33
- "unexpectedError": "An unexpected error occurred"
34
- },
35
- "actions": {
36
- "dismiss": "Dismiss",
37
- "retry": "Retry",
38
- "goBack": "Go Back",
39
- "contactSupport": "Contact Support"
40
- }
41
- }
@@ -1,57 +0,0 @@
1
- {
2
- "cancel": "Cancel",
3
- "confirm": "Confirm",
4
- "continue": "Continue",
5
- "delete": "Delete",
6
- "edit": "Edit",
7
- "error": "Error",
8
- "loading": "Loading...",
9
- "notNow": "Not Now",
10
- "ok": "OK",
11
- "optional": "Optional",
12
- "save": "Save",
13
- "somethingWentWrong": "Something went wrong",
14
- "success": "Success",
15
- "close": "Close",
16
- "done": "Done",
17
- "next": "Next",
18
- "previous": "Previous",
19
- "skip": "Skip",
20
- "retry": "Retry",
21
- "refresh": "Refresh",
22
- "filter": "Filter",
23
- "sort": "Sort",
24
- "add": "Add",
25
- "remove": "Remove",
26
- "update": "Update",
27
- "create": "Create",
28
- "view": "View",
29
- "details": "Details",
30
- "share": "Share",
31
- "download": "Download",
32
- "upload": "Upload",
33
- "submit": "Submit",
34
- "reset": "Reset",
35
- "clear": "Clear",
36
- "apply": "Apply",
37
- "yes": "Yes",
38
- "no": "No",
39
- "or": "or",
40
- "all": "All",
41
- "none": "None",
42
- "of": "of",
43
- "select": "Select",
44
- "selected": "Selected",
45
- "required": "Required",
46
- "empty": "Empty",
47
- "noData": "No data available",
48
- "noResults": "No results found",
49
- "tryAgain": "Try again",
50
- "learnMore": "Learn more",
51
- "getStarted": "Get started",
52
- "viewAll": "View all",
53
- "showMore": "Show more",
54
- "showLess": "Show less",
55
- "back": "Back",
56
- "start": "Start"
57
- }
@@ -1,5 +0,0 @@
1
- {
2
- "list": {
3
- "title": "Goals"
4
- }
5
- }
@@ -1,6 +0,0 @@
1
- {
2
- "haptics": {
3
- "notSupported": "Haptics not supported on this device",
4
- "disabled": "Haptic feedback disabled"
5
- }
6
- }
@@ -1,62 +0,0 @@
1
- {
2
- "greeting": "Create Amazing Videos",
3
- "subtitle": "Choose a template and start creating",
4
- "categories": {
5
- "title": "Browse by Category"
6
- },
7
- "recent_projects": {
8
- "title": "Recent Projects",
9
- "view_all": "View All",
10
- "empty": "No recent projects"
11
- },
12
- "quick_actions": {
13
- "title": "Quick Actions",
14
- "browse_templates": "Browse Templates",
15
- "my_projects": "My Projects",
16
- "create_blank": "Create Blank"
17
- },
18
- "featured": {
19
- "title": "Featured Templates",
20
- "view_all": "View All"
21
- },
22
- "ai_hero": {
23
- "title": "🎬 AI Video Studio",
24
- "subtitle": "Create professional videos with AI-powered tools",
25
- "start_button": "Start Creating"
26
- },
27
- "ai_features": {
28
- "title": "🤖 AI Features",
29
- "text_to_video": {
30
- "title": "Text to Video",
31
- "description": "Generate videos from prompts"
32
- },
33
- "image_to_video": {
34
- "title": "Image to Video",
35
- "description": "Animate your photos"
36
- },
37
- "style_transfer": {
38
- "title": "Style Transfer",
39
- "description": "Transform video styles"
40
- },
41
- "script_generator": {
42
- "title": "Script Generator",
43
- "description": "AI-powered scripts"
44
- },
45
- "voice_over": {
46
- "title": "AI Voice-over",
47
- "description": "Text-to-speech"
48
- },
49
- "auto_captions": {
50
- "title": "Auto Captions",
51
- "description": "AI subtitles"
52
- },
53
- "ai_music": {
54
- "title": "AI Music",
55
- "description": "Generate soundtracks"
56
- },
57
- "ai_prompt": {
58
- "title": "AI Prompt",
59
- "description": "Scene generator"
60
- }
61
- }
62
- }
@@ -1,54 +0,0 @@
1
- /**
2
- * Translation loader for en-US with namespace support
3
- *
4
- * Each JSON file represents a namespace that can be accessed via:
5
- * t('namespace:key') or t('namespace:nested.key')
6
- *
7
- * Example:
8
- * t('common:cancel') -> "Cancel"
9
- * t('auth:login.title') -> "Sign In"
10
- */
11
-
12
- import alerts from './alerts.json';
13
- import auth from './auth.json';
14
- import branding from './branding.json';
15
- import clipboard from './clipboard.json';
16
- import common from './common.json';
17
- import datetime from './datetime.json';
18
- import device from './device.json';
19
- import editor from './editor.json';
20
- import errors from './errors.json';
21
- import general from './general.json';
22
- import goals from './goals.json';
23
- import haptics from './haptics.json';
24
- import home from './home.json';
25
- import navigation from './navigation.json';
26
- import onboarding from './onboarding.json';
27
- import projects from './projects.json';
28
- import settings from './settings.json';
29
- import sharing from './sharing.json';
30
- import templates from './templates.json';
31
-
32
- const translations = {
33
- alerts,
34
- auth,
35
- branding,
36
- clipboard,
37
- common,
38
- datetime,
39
- device,
40
- editor,
41
- errors,
42
- general,
43
- goals,
44
- haptics,
45
- home,
46
- navigation,
47
- onboarding,
48
- projects,
49
- settings,
50
- sharing,
51
- templates,
52
- };
53
-
54
- export default translations;
@@ -1,6 +0,0 @@
1
- {
2
- "home": "Home",
3
- "templates": "Templates",
4
- "projects": "Projects",
5
- "settings": "Settings"
6
- }
@@ -1,26 +0,0 @@
1
- {
2
- "skip": "Skip",
3
- "back": "Back",
4
- "next": "Next",
5
- "getStarted": "Get Started",
6
- "slides": {
7
- "slide1": {
8
- "title": "AI Video Creator",
9
- "description": "Create stunning videos with AI - from text to video, images to video, and templates"
10
- },
11
- "slide2": {
12
- "title": "Multiple Creation Methods",
13
- "description": "Generate videos from text descriptions, upload images, or use ready templates",
14
- "features": ["Text to Video", "Image to Video", "AI Script Generator"]
15
- },
16
- "slide3": {
17
- "title": "Professional Editing",
18
- "description": "Edit videos with advanced tools - add text, animations, music and effects",
19
- "features": ["Text Overlays", "Animations", "Audio Tracks"]
20
- },
21
- "slide4": {
22
- "title": "Start Creating",
23
- "description": "Begin your video creation journey with AI-powered tools"
24
- }
25
- }
26
- }
@@ -1,34 +0,0 @@
1
- {
2
- "screen": {
3
- "title": "My Projects",
4
- "search_placeholder": "Search projects...",
5
- "empty_title": "No projects yet",
6
- "empty_description": "Create your first video from a template",
7
- "create_button": "Browse Templates"
8
- },
9
- "card": {
10
- "created": "Created {{date}}",
11
- "updated": "Updated {{date}}",
12
- "duration": "{{duration}}s"
13
- },
14
- "actions": {
15
- "edit": "Edit",
16
- "duplicate": "Duplicate",
17
- "delete": "Delete",
18
- "export": "Export",
19
- "share": "Share"
20
- },
21
- "delete": {
22
- "title": "Delete Project",
23
- "message": "Are you sure you want to delete this project? This action cannot be undone.",
24
- "confirm": "Delete",
25
- "cancel": "Cancel"
26
- },
27
- "sort": {
28
- "title": "Sort by",
29
- "recent": "Most Recent",
30
- "oldest": "Oldest",
31
- "name": "Name (A-Z)",
32
- "duration": "Duration"
33
- }
34
- }
@@ -1,45 +0,0 @@
1
- {
2
- "lightMode": "Light Mode",
3
- "darkMode": "Dark Mode",
4
- "language": "Language",
5
- "about": {
6
- "title": "About",
7
- "description": "App information and version",
8
- "appVersion": "App Version",
9
- "contactEmail": "Contact Email",
10
- "website": "Website"
11
- },
12
- "legal": {
13
- "title": "Legal",
14
- "description": "Privacy policy, terms of use, and EULA",
15
- "privacy": "Privacy Policy",
16
- "privacyDescription": "How we handle your data",
17
- "terms": "Terms of Use",
18
- "termsDescription": "Terms and conditions",
19
- "eula": "End User License Agreement",
20
- "eulaDescription": "License agreement"
21
- },
22
- "version": {
23
- "title": "App Version"
24
- },
25
- "languageSelection": {
26
- "title": "Select Language",
27
- "description": "Choose your preferred language",
28
- "currentLanguage": "Current Language",
29
- "searchPlaceholder": "Search languages"
30
- },
31
- "appearance": {
32
- "title": "Appearance",
33
- "darkMode": "Dark Mode",
34
- "darkTheme": "Dark Theme",
35
- "lightTheme": "Light Theme",
36
- "themeDescription": "Theme settings"
37
- },
38
- "notifications": {
39
- "title": "Notifications",
40
- "description": "Manage notification preferences",
41
- "enableNotifications": "Enable Notifications",
42
- "notificationPermission": "Notification Permission",
43
- "notificationPermissionDescription": "Allow app to send notifications"
44
- }
45
- }
@@ -1,8 +0,0 @@
1
- {
2
- "sharing": {
3
- "share": "Share",
4
- "shareWith": "Share with",
5
- "shareFailed": "Failed to share",
6
- "notAvailable": "Sharing not available on this device"
7
- }
8
- }
@@ -1,28 +0,0 @@
1
- {
2
- "categories": {
3
- "all": "All Templates",
4
- "social_media": "Social Media",
5
- "business": "Business",
6
- "education": "Education",
7
- "marketing": "Marketing",
8
- "event": "Events",
9
- "intro_outro": "Intro/Outro"
10
- },
11
- "screen": {
12
- "title": "Templates",
13
- "search_placeholder": "Search templates...",
14
- "no_results": "No templates found",
15
- "no_results_description": "Try adjusting your search or browse by category"
16
- },
17
- "card": {
18
- "duration": "{{duration}}s",
19
- "premium": "Premium",
20
- "use_template": "Use Template"
21
- },
22
- "filters": {
23
- "all": "All",
24
- "favorites": "Favorites",
25
- "free": "Free",
26
- "premium": "Premium"
27
- }
28
- }