diff --git a/.eslintrc.js b/.eslintrc.js index 2692cbdf5b..cb82db1ccc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,7 +21,7 @@ module.exports = { }, parser: '@typescript-eslint/parser', parserOptions: { - project: './tsconfig.json', + project: ['./tsconfig.json', './scripts/tsconfig.json'], tsconfigRootDir: './', }, settings: { diff --git a/package.json b/package.json index c23dd474ec..2645bba336 100644 --- a/package.json +++ b/package.json @@ -101,11 +101,12 @@ "prepublishOnly": "npm run build", "test": "react-scripts test --detectOpenHandles", "test:ci": "cross-env CI=true react-scripts test --passWithNoTests", - "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", - "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix", + "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,ts}\"", + "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,ts}\" --fix", "lint-staged": "lint-staged", "commitlint": "commitlint", - "coveralls": "npm run test:ci -- --coverage --watchAll=false && cat ./coverage/lcov.info" + "coveralls": "npm run test:ci -- --coverage --watchAll=false && cat ./coverage/lcov.info", + "translation:check": "ts-node-script scripts/checkMissingTranslations.ts" }, "browserslist": { "production": [ diff --git a/report.20200502.093222.73540.0.001.json b/report.20200502.093222.73540.0.001.json new file mode 100644 index 0000000000..a9987d509d --- /dev/null +++ b/report.20200502.093222.73540.0.001.json @@ -0,0 +1,583 @@ + +{ + "header": { + "reportVersion": 2, + "event": "Allocation failed - JavaScript heap out of memory", + "trigger": "FatalError", + "filename": "report.20200502.093222.73540.0.001.json", + "dumpEventTime": "2020-05-02T09:32:22Z", + "dumpEventTimeStamp": "1588404742883", + "processId": 73540, + "threadId": null, + "cwd": "/Users/marcomoretti/Projects/opensoruce/hospitalrun-frontend", + "commandLine": [ + "/usr/local/bin/node", + "/Users/marcomoretti/Library/Application Support/JetBrains/Toolbox/apps/WebStorm/ch-0/201.6668.106/WebStorm.app/Contents/plugins/JavaScriptLanguage/jsLanguageServicesImpl/js-language-service.js", + "-id=1588329429193", + "-debug-name=typescript" + ], + "nodejsVersion": "v12.16.2", + "wordSize": 64, + "arch": "x64", + "platform": "darwin", + "componentVersions": { + "node": "12.16.2", + "v8": "7.8.279.23-node.34", + "uv": "1.34.2", + "zlib": "1.2.11", + "brotli": "1.0.7", + "ares": "1.15.0", + "modules": "72", + "nghttp2": "1.40.0", + "napi": "5", + "llhttp": "2.0.4", + "http_parser": "2.9.3", + "openssl": "1.1.1e", + "cldr": "36.0", + "icu": "65.1", + "tz": "2019c", + "unicode": "12.1" + }, + "release": { + "name": "node", + "lts": "Erbium", + "headersUrl": "https://nodejs.org/download/release/v12.16.2/node-v12.16.2-headers.tar.gz", + "sourceUrl": "https://nodejs.org/download/release/v12.16.2/node-v12.16.2.tar.gz" + }, + "osName": "Darwin", + "osRelease": "19.4.0", + "osVersion": "Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64", + "osMachine": "x86_64", + "cpus": [ + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 170871260, + "nice": 0, + "sys": 108802040, + "idle": 1064377800, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 23518260, + "nice": 0, + "sys": 15214070, + "idle": 1305316280, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 148958620, + "nice": 0, + "sys": 69924470, + "idle": 1125165810, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 21378000, + "nice": 0, + "sys": 10219120, + "idle": 1312451370, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 123761580, + "nice": 0, + "sys": 53897210, + "idle": 1166389990, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 21588560, + "nice": 0, + "sys": 8980710, + "idle": 1313479140, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 107123810, + "nice": 0, + "sys": 43481380, + "idle": 1193443510, + "irq": 0 + }, + { + "model": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz", + "speed": 2700, + "user": 22214630, + "nice": 0, + "sys": 8390440, + "idle": 1313443260, + "irq": 0 + } + ], + "networkInterfaces": [ + { + "name": "lo0", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "127.0.0.1", + "netmask": "255.0.0.0", + "family": "IPv4" + }, + { + "name": "lo0", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "::1", + "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "lo0", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "fe80::1", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 1 + }, + { + "name": "en0", + "internal": false, + "mac": "78:4f:43:80:35:9c", + "address": "fe80::1046:5fe3:8e4a:ba31", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 5 + }, + { + "name": "en0", + "internal": false, + "mac": "78:4f:43:80:35:9c", + "address": "192.168.1.189", + "netmask": "255.255.255.0", + "family": "IPv4" + }, + { + "name": "en0", + "internal": false, + "mac": "78:4f:43:80:35:9c", + "address": "2001:b07:6462:c652:100d:4cef:6739:101", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "en0", + "internal": false, + "mac": "78:4f:43:80:35:9c", + "address": "2001:b07:6462:c652:2871:83f0:e3a3:c023", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "awdl0", + "internal": false, + "mac": "a2:93:e4:52:e2:5b", + "address": "fe80::a093:e4ff:fe52:e25b", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 15 + }, + { + "name": "llw0", + "internal": false, + "mac": "a2:93:e4:52:e2:5b", + "address": "fe80::a093:e4ff:fe52:e25b", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 16 + }, + { + "name": "utun0", + "internal": false, + "mac": "00:00:00:00:00:00", + "address": "fe80::8236:539f:66b8:7a94", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 17 + }, + { + "name": "utun1", + "internal": false, + "mac": "00:00:00:00:00:00", + "address": "fe80::ab9f:c9c6:dd7f:fdae", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 18 + }, + { + "name": "utun2", + "internal": false, + "mac": "00:00:00:00:00:00", + "address": "fe80::930f:fe4d:fada:8c", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 19 + }, + { + "name": "utun3", + "internal": false, + "mac": "00:00:00:00:00:00", + "address": "fe80::ec6f:e975:de9d:d512", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 20 + }, + { + "name": "en6", + "internal": false, + "mac": "ac:de:48:00:11:22", + "address": "fe80::aede:48ff:fe00:1122", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 4 + } + ], + "host": "MBP-di-Marco.lan" + }, + "javascriptStack": { + "message": "No stack.", + "stack": [ + "Unavailable." + ] + }, + "nativeStack": [ + { + "pc": "0x00000001001636d3", + "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__1::basic_string, std::__1::allocator > const&, v8::Local) [/usr/local/bin/node]" + }, + { + "pc": "0x0000000100084d5a", + "symbol": "node::OnFatalError(char const*, char const*) [/usr/local/bin/node]" + }, + { + "pc": "0x0000000100186477", + "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]" + }, + { + "pc": "0x0000000100186417", + "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]" + }, + { + "pc": "0x00000001003141c5", + "symbol": "v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]" + }, + { + "pc": "0x0000000100315a3a", + "symbol": "v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010031246c", + "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010031026e", + "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010031c13a", + "symbol": "v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010031c1c1", + "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]" + }, + { + "pc": "0x00000001002e9dfa", + "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010063f028", + "symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]" + }, + { + "pc": "0x000000010097d5b9", + "symbol": "Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]" + }, + { + "pc": "0x0000000100904441", + "symbol": "Builtins_GrowFastSmiOrObjectElements [/usr/local/bin/node]" + } + ], + "javascriptHeap": { + "totalMemory": 2183659520, + "totalCommittedMemory": 2166342576, + "usedMemory": 2136066464, + "availableMemory": 53900224, + "memoryLimit": 2197815296, + "heapSpaces": { + "read_only_space": { + "memorySize": 262144, + "committedMemory": 33088, + "capacity": 32808, + "used": 32808, + "available": 0 + }, + "new_space": { + "memorySize": 33554432, + "committedMemory": 17910120, + "capacity": 16759296, + "used": 6143600, + "available": 10615696 + }, + "old_space": { + "memorySize": 1988501504, + "committedMemory": 1987577272, + "capacity": 1982808168, + "used": 1970438712, + "available": 12369456 + }, + "code_space": { + "memorySize": 5148672, + "committedMemory": 4859904, + "capacity": 4394112, + "used": 4394112, + "available": 0 + }, + "map_space": { + "memorySize": 1314816, + "committedMemory": 1084240, + "capacity": 756480, + "used": 756480, + "available": 0 + }, + "large_object_space": { + "memorySize": 154492928, + "committedMemory": 154492928, + "capacity": 153977168, + "used": 153977168, + "available": 0 + }, + "code_large_object_space": { + "memorySize": 385024, + "committedMemory": 385024, + "capacity": 323584, + "used": 323584, + "available": 0 + }, + "new_large_object_space": { + "memorySize": 0, + "committedMemory": 0, + "capacity": 16759296, + "used": 0, + "available": 16759296 + } + } + }, + "resourceUsage": { + "userCpuSeconds": 1341.99, + "kernelCpuSeconds": 566.013, + "cpuConsumptionPercent": 2.53344, + "maxRss": 2342430703616, + "pageFaults": { + "IORequired": 0, + "IONotRequired": 11092751 + }, + "fsActivity": { + "reads": 0, + "writes": 0 + } + }, + "libuv": [ + ], + "workers": [ + ], + "environmentVariables": { + "PATH": "/Users/marcomoretti/bin:/usr/local/bin:/System/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/marcomoretti/Library/Android/sdk/platform-tools:/Users/marcomoretti/flutter/bin:/Users/marcomoretti/Library/Python/3.7/bin", + "SHELL": "/bin/zsh", + "PAGER": "less", + "LSCOLORS": "Gxfxcxdxbxegedabagacad", + "OLDPWD": "/", + "USER": "marcomoretti", + "ZSH": "/Users/marcomoretti/.oh-my-zsh", + "TMPDIR": "/var/folders/pb/n1md4_q53m5fc62nk744m0m00000gn/T/", + "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.Vf6PGfw5ga/Listeners", + "XPC_FLAGS": "0x0", + "VERSIONER_PYTHON_VERSION": "2.7", + "__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x4", + "LESS": "-R", + "LOGNAME": "marcomoretti", + "LC_CTYPE": "it_IT.UTF-8", + "XPC_SERVICE_NAME": "com.jetbrains.WebStorm.4112", + "PWD": "/Users/marcomoretti/Projects/opensoruce/hospitalrun-frontend", + "HOME": "/Users/marcomoretti" + }, + "userLimits": { + "core_file_size_blocks": { + "soft": 0, + "hard": "unlimited" + }, + "data_seg_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_locked_memory_bytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_memory_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "open_files": { + "soft": 24576, + "hard": "unlimited" + }, + "stack_size_bytes": { + "soft": 8388608, + "hard": 67104768 + }, + "cpu_time_seconds": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_user_processes": { + "soft": 2784, + "hard": 4176 + }, + "virtual_memory_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + } + }, + "sharedObjects": [ + "/usr/local/bin/node", + "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation", + "/usr/lib/libSystem.B.dylib", + "/usr/lib/libc++.1.dylib", + "/usr/lib/libobjc.A.dylib", + "/usr/lib/libfakelink.dylib", + "/usr/lib/libDiagnosticMessagesClient.dylib", + "/usr/lib/libicucore.A.dylib", + "/usr/lib/libz.1.dylib", + "/usr/lib/libc++abi.dylib", + "/usr/lib/system/libcache.dylib", + "/usr/lib/system/libcommonCrypto.dylib", + "/usr/lib/system/libcompiler_rt.dylib", + "/usr/lib/system/libcopyfile.dylib", + "/usr/lib/system/libcorecrypto.dylib", + "/usr/lib/system/libdispatch.dylib", + "/usr/lib/system/libdyld.dylib", + "/usr/lib/system/libkeymgr.dylib", + "/usr/lib/system/liblaunch.dylib", + "/usr/lib/system/libmacho.dylib", + "/usr/lib/system/libquarantine.dylib", + "/usr/lib/system/libremovefile.dylib", + "/usr/lib/system/libsystem_asl.dylib", + "/usr/lib/system/libsystem_blocks.dylib", + "/usr/lib/system/libsystem_c.dylib", + "/usr/lib/system/libsystem_configuration.dylib", + "/usr/lib/system/libsystem_coreservices.dylib", + "/usr/lib/system/libsystem_darwin.dylib", + "/usr/lib/system/libsystem_dnssd.dylib", + "/usr/lib/system/libsystem_featureflags.dylib", + "/usr/lib/system/libsystem_info.dylib", + "/usr/lib/system/libsystem_m.dylib", + "/usr/lib/system/libsystem_malloc.dylib", + "/usr/lib/system/libsystem_networkextension.dylib", + "/usr/lib/system/libsystem_notify.dylib", + "/usr/lib/system/libsystem_sandbox.dylib", + "/usr/lib/system/libsystem_secinit.dylib", + "/usr/lib/system/libsystem_kernel.dylib", + "/usr/lib/system/libsystem_platform.dylib", + "/usr/lib/system/libsystem_pthread.dylib", + "/usr/lib/system/libsystem_symptoms.dylib", + "/usr/lib/system/libsystem_trace.dylib", + "/usr/lib/system/libunwind.dylib", + "/usr/lib/system/libxpc.dylib", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices", + "/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList", + "/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation", + "/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit", + "/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration", + "/System/Library/Frameworks/Security.framework/Versions/A/Security", + "/usr/lib/libsqlite3.dylib", + "/usr/lib/libxml2.2.dylib", + "/usr/lib/libnetwork.dylib", + "/usr/lib/libapple_nghttp2.dylib", + "/usr/lib/libauto.dylib", + "/usr/lib/libcompression.dylib", + "/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration", + "/usr/lib/libarchive.2.dylib", + "/usr/lib/liblangid.dylib", + "/usr/lib/libCRFSuite.dylib", + "/usr/lib/liblzma.5.dylib", + "/usr/lib/libenergytrace.dylib", + "/usr/lib/libbsm.0.dylib", + "/usr/lib/system/libkxld.dylib", + "/System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression", + "/usr/lib/libcoretls.dylib", + "/usr/lib/libcoretls_cfhelpers.dylib", + "/usr/lib/libpam.2.dylib", + "/usr/lib/libxar.1.dylib", + "/usr/lib/libbz2.1.0.dylib", + "/usr/lib/libiconv.2.dylib", + "/usr/lib/libcharset.1.dylib", + "/usr/lib/libpcap.A.dylib", + "/System/Library/Frameworks/NetFS.framework/Versions/A/NetFS", + "/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth", + "/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport", + "/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC", + "/System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP", + "/System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities", + "/usr/lib/libmecabra.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate", + "/usr/lib/libmecab.dylib", + "/usr/lib/libgermantok.dylib", + "/usr/lib/libThaiTokenizer.dylib", + "/usr/lib/libChineseTokenizer.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib", + "/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling", + "/System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji", + "/System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData", + "/System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon", + "/usr/lib/libcmph.dylib", + "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory", + "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory", + "/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS", + "/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation", + "/usr/lib/libutil.dylib", + "/System/Library/PrivateFrameworks/CoreServicesStore.framework/Versions/A/CoreServicesStore", + "/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement", + "/System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement", + "/usr/lib/libxslt.1.dylib" + ] +} \ No newline at end of file diff --git a/scripts/checkMissingTranslations.ts b/scripts/checkMissingTranslations.ts new file mode 100644 index 0000000000..0d4c6a59c7 --- /dev/null +++ b/scripts/checkMissingTranslations.ts @@ -0,0 +1,59 @@ +import { Resource, ResourceKey } from 'i18next' +import i18n from '../src/i18n' + +const checkRecursiveTranslation = ( + searchingPath: string, + defaultLanguageObject: ResourceKey, + translatedLanguageObject: ResourceKey, +) => { + if (typeof defaultLanguageObject === 'string' || typeof translatedLanguageObject === 'string') { + if (typeof defaultLanguageObject === 'object') { + console.log( + `πŸ“™ Found a string for path ${searchingPath} while is and object for the default language`, + ) + } + return + } + const defaultKeys: string[] = Object.keys(defaultLanguageObject) + const translatedKeys: string[] = Object.keys(translatedLanguageObject) + if (defaultKeys.length === 0 || translatedKeys.length === 0) { + return + } + defaultKeys.forEach((key) => { + if (!translatedLanguageObject[key]) { + console.log(`πŸ“™ The key ${key} is not present for path ${searchingPath}`) + } else { + checkRecursiveTranslation( + `${searchingPath}-->${key}`, + defaultLanguageObject[key], + translatedLanguageObject[key], + ) + } + }) +} + +const run = () => { + const resources: Resource = i18n.options.resources ?? {} + const languages = Object.keys(resources) + const defaultLanguage = 'en' + console.log( + '🏁 Start finding translation problem comparing all languages with the default one (English)', + ) + console.log('') + if (!resources[defaultLanguage]) { + console.log('πŸ“• We have a big problem.... the english language is not found!') + process.exit(1) + } + + languages.forEach((language) => { + if (language === defaultLanguage) { + return + } + console.log(`🀞Checking ${language}`) + console.log('') + checkRecursiveTranslation(language, resources[defaultLanguage], resources[language]) + console.log('') + }) +} + +run() diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json new file mode 100644 index 0000000000..aff04d0372 --- /dev/null +++ b/scripts/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "include": ["./checkMissingTranslations.ts"], + "compilerOptions": { + "module": "commonjs" + } +}