@jjlmoya/utils-home 1.7.0 → 1.8.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-home",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,27 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import type { ToolLocaleContent } from '../types';
4
+
5
+ describe('Slug Language Code Format Validation', () => {
6
+ const languageCodes = ['de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'];
7
+
8
+ ALL_TOOLS.forEach((tool) => {
9
+ describe(`Tool: ${tool.entry.id}`, () => {
10
+ it('slug should not end with 2-letter language codes like -ja, -ru, -ko', async () => {
11
+ const locales = Object.keys(tool.entry.i18n);
12
+
13
+ for (const locale of locales) {
14
+ const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
15
+ const content = (await loader?.()) as ToolLocaleContent;
16
+
17
+ const endsWithLanguageCode = languageCodes.some(code => content.slug.endsWith(`-${code}`));
18
+
19
+ expect(
20
+ endsWithLanguageCode,
21
+ `Tool "${tool.entry.id}" locale "${locale}" slug ("${content.slug}") cannot end with a language code like -ja, -ru, -ko, -de, etc.`,
22
+ ).toBe(false);
23
+ }
24
+ });
25
+ });
26
+ });
27
+ });
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { HeatingComparatorUI } from '../ui';
4
4
 
5
- const slug = 'perbandingan-pemanas-gas-vs-pompa-panas-vs-ac';
5
+ const slug = 'perbandingan-pemanas-gas-pompa-panas-aircond';
6
6
  const title = 'Perbandingan Gas vs. Pompa Panas vs. AC: Hemat & Konsumsi';
7
7
  const description = 'Hitung berapa banyak Anda berhemat dengan mengganti boiler gas ke pompa panas atau AC. Perbandingan nyata konsumsi energi dan efisiensi untuk rumah Anda.';
8
8
 
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { QRGeneratorUI } from '../ui';
4
4
 
5
- const slug = 'offline-qr-code-generator-de';
5
+ const slug = 'offline-qr-code-generator';
6
6
  const title = 'Offline QR Code Generator';
7
7
  const description =
8
8
  'Erstellen Sie QR-Codes für WLAN, URLs und Kontakte 100 % sicher in Ihrem Browser. Ihre Daten verlassen niemals Ihr Gerät.';
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { QRGeneratorUI } from '../ui';
4
4
 
5
- const slug = 'offline-qr-code-generator-nl';
5
+ const slug = 'offline-qr-code-generator-dutch';
6
6
  const title = 'Offline QR Code Generator';
7
7
  const description =
8
8
  'Genereer 100% veilig QR-codes voor WiFi, URL\'s en contacten in uw browser. Uw gegevens ver laten uw apparaat nooit.';
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { QRGeneratorUI } from '../ui';
4
4
 
5
- const slug = 'oflayn-qr-kod-generator-ru';
5
+ const slug = 'oflayn-qr-kod-generator';
6
6
  const title = 'Оффлайн Генератор QR кодов';
7
7
  const description =
8
8
  'Создавайте QR-коды для WiFi, URL и Контактов полностью безопасно в вашем браузере. Ваши данные никогда не покидают устройство.';
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { QRGeneratorUI } from '../ui';
4
4
 
5
- const slug = 'offline-qr-kod-generator-sv';
5
+ const slug = 'offline-qr-kod-generator';
6
6
  const title = 'Offline QR Kod Generator';
7
7
  const description =
8
8
  'Skapa QR-koder för WiFi, URL och Kontakter 100% säkert i din webbläsare. Dina data lämnar aldrig din enhet.';