@umituz/react-native-google-translate 1.0.5 → 1.0.7

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 (30) hide show
  1. package/dist/domain/entities/Language.entity.js +2 -1
  2. package/dist/domain/entities/Translation.entity.js +2 -1
  3. package/dist/domain/entities/index.js +2 -1
  4. package/dist/domain/index.js +18 -2
  5. package/dist/domain/interfaces/ITranslationService.interface.js +2 -1
  6. package/dist/domain/interfaces/index.js +2 -1
  7. package/dist/infrastructure/constants/api.constants.js +7 -4
  8. package/dist/infrastructure/constants/index.js +12 -2
  9. package/dist/infrastructure/constants/languages.constants.js +6 -3
  10. package/dist/infrastructure/index.js +25 -0
  11. package/dist/infrastructure/services/GoogleTranslate.service.js +123 -39
  12. package/dist/infrastructure/services/index.js +16 -3
  13. package/dist/infrastructure/utils/index.js +16 -0
  14. package/dist/infrastructure/utils/rateLimit.util.js +5 -1
  15. package/dist/infrastructure/utils/textValidator.util.js +18 -10
  16. package/dist/scripts/index.js +20 -4
  17. package/dist/scripts/setup.js +23 -15
  18. package/dist/scripts/sync.js +39 -30
  19. package/dist/scripts/translate.js +28 -20
  20. package/dist/scripts/utils/file-parser.js +19 -11
  21. package/dist/scripts/utils/index.js +21 -5
  22. package/dist/scripts/utils/key-detector.js +6 -2
  23. package/dist/scripts/utils/key-extractor.js +17 -11
  24. package/dist/scripts/utils/object-helper.js +6 -2
  25. package/dist/scripts/utils/sync-helper.js +6 -2
  26. package/package.json +1 -1
  27. package/src/infrastructure/services/GoogleTranslate.service.ts +123 -24
  28. package/src/scripts/setup.ts +2 -1
  29. package/src/scripts/sync.ts +2 -1
  30. package/src/scripts/translate.ts +2 -1
@@ -90,6 +90,7 @@ export function runSetupLanguages(): void {
90
90
  setupLanguages({ targetDir });
91
91
  }
92
92
 
93
- if (import.meta.url === `file://${process.argv[1]}`) {
93
+ // Check if this file is being run directly
94
+ if (require.main === module || process.argv[1].endsWith('/setup.js') || process.argv[1].endsWith('\\setup.js')) {
94
95
  runSetupLanguages();
95
96
  }
@@ -148,6 +148,7 @@ export function runSyncTranslations(): void {
148
148
  syncTranslations({ targetDir, srcDir });
149
149
  }
150
150
 
151
- if (import.meta.url === `file://${process.argv[1]}`) {
151
+ // Check if this file is being run directly
152
+ if (require.main === module || process.argv[1].endsWith('/sync.js') || process.argv[1].endsWith('\\sync.js')) {
152
153
  runSyncTranslations();
153
154
  }
@@ -121,6 +121,7 @@ export function runTranslateMissing(): void {
121
121
  });
122
122
  }
123
123
 
124
- if (import.meta.url === `file://${process.argv[1]}`) {
124
+ // Check if this file is being run directly
125
+ if (require.main === module || process.argv[1].endsWith('/translate.js') || process.argv[1].endsWith('\\translate.js')) {
125
126
  runTranslateMissing();
126
127
  }