gtx-cli 2.1.3 → 2.1.5
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.
- package/CHANGELOG.md +17 -0
- package/dist/utils/localizeStaticUrls.js +5 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#576](https://github.com/generaltranslation/gt/pull/576) [`be9c1ff`](https://github.com/generaltranslation/gt/commit/be9c1ff24c9a15a35e3f0da26e9ec941e5b41eea) Thanks [@SamEggert](https://github.com/SamEggert)! - Fix url localization
|
|
8
|
+
|
|
9
|
+
## 2.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#536](https://github.com/generaltranslation/gt/pull/536) [`468b0b7`](https://github.com/generaltranslation/gt/commit/468b0b7c660fd1ab9e8c2611a26ade63ba268e80) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Added locale selection based on region
|
|
14
|
+
Added compile time hashing
|
|
15
|
+
Added es lint plugin for gt-next (in alpha)
|
|
16
|
+
Fix CLI validation (used to error for {<JSX/>} inside <T>)
|
|
17
|
+
- Updated dependencies [[`468b0b7`](https://github.com/generaltranslation/gt/commit/468b0b7c660fd1ab9e8c2611a26ade63ba268e80)]:
|
|
18
|
+
- generaltranslation@7.4.0
|
|
19
|
+
|
|
3
20
|
## 2.1.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -76,6 +76,10 @@ export default async function localizeStaticUrls(settings) {
|
|
|
76
76
|
* Determines if a URL should be processed based on pattern matching
|
|
77
77
|
*/
|
|
78
78
|
function shouldProcessUrl(originalUrl, patternHead, targetLocale, defaultLocale) {
|
|
79
|
+
// Skip absolute URLs (http://, https://, //, etc.)
|
|
80
|
+
if (originalUrl.includes(':')) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
79
83
|
const patternWithoutSlash = patternHead.replace(/\/$/, '');
|
|
80
84
|
if (targetLocale === defaultLocale) {
|
|
81
85
|
// For default locale processing, check if URL contains the pattern
|
|
@@ -145,7 +149,7 @@ function transformNonDefaultLocaleUrlWithHidden(originalUrl, patternHead, target
|
|
|
145
149
|
return `${patternHead.replace(/\/$/, '')}/${targetLocale}`;
|
|
146
150
|
}
|
|
147
151
|
// Add target locale to URL without any locale
|
|
148
|
-
const pathAfterHead = originalUrl.slice(patternHead.length);
|
|
152
|
+
const pathAfterHead = originalUrl.slice(originalUrl.startsWith(patternHead) ? patternHead.length : 0);
|
|
149
153
|
return pathAfterHead
|
|
150
154
|
? `${patternHead}${targetLocale}/${pathAfterHead}`
|
|
151
155
|
: `${patternHead}${targetLocale}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/main.js",
|
|
6
6
|
"files": [
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"esbuild": "^0.25.4",
|
|
88
88
|
"fast-glob": "^3.3.3",
|
|
89
89
|
"form-data": "^4.0.4",
|
|
90
|
-
"generaltranslation": "^7.
|
|
90
|
+
"generaltranslation": "^7.4.0",
|
|
91
91
|
"json-pointer": "^0.6.2",
|
|
92
92
|
"jsonpath-plus": "^10.3.0",
|
|
93
93
|
"jsonpointer": "^5.0.1",
|