Ver código fonte

fix: translation percent transform

Sv443 3 meses atrás
pai
commit
b47f5e2f00
3 arquivos alterados com 9 adições e 6 exclusões
  1. 1 1
      package.json
  2. 5 5
      pnpm-lock.yaml
  3. 3 0
      src/utils/translations.ts

+ 1 - 1
package.json

@@ -64,7 +64,7 @@
     "openuserjs": "https://openuserjs.org/scripts/Sv443/BetterYTM"
   },
   "dependencies": {
-    "@sv443-network/userutils": "^9.0.3",
+    "@sv443-network/userutils": "^9.0.4",
     "compare-versions": "^6.1.0",
     "dompurify": "^3.1.6",
     "marked": "^12.0.2",

+ 5 - 5
pnpm-lock.yaml

@@ -9,8 +9,8 @@ importers:
   .:
     dependencies:
       '@sv443-network/userutils':
-        specifier: ^9.0.3
-        version: 9.0.3
+        specifier: ^9.0.4
+        version: 9.0.4
       compare-versions:
         specifier: ^6.1.0
         version: 6.1.0
@@ -1828,8 +1828,8 @@ packages:
   '@storybook/[email protected]':
     resolution: {integrity: sha512-UJ97iqI+0Mk13I6ayd3TaBfSFBkWnEauwTnFMQe1dN/L3wTh8laOBaLa0Vr3utRSnt2b5hpcw/nq7azB/Gx4Yw==}
 
-  '@sv443-network/[email protected].3':
-    resolution: {integrity: sha512-bWNWgxwBDeJ1xI269FqLlVDHUKRiEMw3HzkkqiG8Ht1mQkC8DozWWOvKChNL1qWGOWtfg7ee3tGGvqCyx38qhA==}
+  '@sv443-network/[email protected].4':
+    resolution: {integrity: sha512-vYf+EvxMgKiU4k/ztThLKV/FaNp+HA53xHm1WmkM9c5Y6q1WsOHdFjJuX7gDg4+QhRa2vvqMzv4AVImYYiCqMQ==}
 
   '@testing-library/[email protected]':
     resolution: {integrity: sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==}
@@ -6816,7 +6816,7 @@ snapshots:
       '@types/express': 4.17.21
       file-system-cache: 2.3.0
 
-  '@sv443-network/[email protected].3':
+  '@sv443-network/[email protected].4':
     dependencies:
       nanoevents: 9.1.0
 

+ 3 - 0
src/utils/translations.ts

@@ -17,6 +17,9 @@ const initializedLocales = new Set<TrLocale>();
 /** The currently active locale */
 let activeLocale: TrLocale = "en-US";
 
+tr.addTransform(tr.transforms.percent);
+tr.addTransform(tr.transforms.templateLiteral);
+
 /** Initializes the translations */
 export async function initTranslations(locale: TrLocale) {
   if(initializedLocales.has(locale))