@openmrs/esm-translations 8.0.1-pre.3328 → 8.0.1-pre.3349

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.
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 3 files with swc (306.74ms)
1
+ [0] Successfully compiled: 3 files with swc (238.31ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
@@ -7,12 +7,18 @@ export default class ObjectLexer extends BaseLexer {
7
7
 
8
8
  // `content` is literally just the text content of the file. We use a
9
9
  // regex matcher to extract the key-value pairs.
10
+ // Supports single quotes, double quotes, and backticks, including escaped quotes.
10
11
  extract(content) {
11
- const regex = /(?<=\s*)(\w+)\s*:\s*'([^']+)'/g;
12
- let keys = []
12
+ const regex = /(\w+)\s*:\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|`((?:[^`\\]|\\.)*)`)/g;
13
+ let keys = [];
13
14
  let match;
14
15
  while ((match = regex.exec(content)) !== null) {
15
- keys.push({ key: match[1], defaultValue: match[2] });
16
+ const key = match[1];
17
+ // The value is in one of groups 2, 3, or 4 depending on quote type
18
+ const rawValue = match[2] || match[3] || match[4];
19
+ // Unescape any escaped characters
20
+ const defaultValue = rawValue.replace(/\\(.)/g, '$1');
21
+ keys.push({ key, defaultValue });
16
22
  }
17
23
  return keys;
18
24
  }
@@ -23,7 +23,7 @@ const workspaceTranslations = {
23
23
  maximize: 'Maximize',
24
24
  minimize: 'Minimize',
25
25
  openAnyway: 'Open anyway',
26
- unsavedChangesInOpenedWorkspace: `You may have unsaved changes in the opened workspace. Do you want to discard these changes?`,
26
+ unsavedChangesInOpenedWorkspace: 'You may have unsaved changes in the opened workspace. Do you want to discard these changes?',
27
27
  unsavedChangesInWorkspace: 'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',
28
28
  unsavedChangesTitleText: 'Unsaved changes',
29
29
  workspaceHeader: 'Workspace header'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-translations",
3
- "version": "8.0.1-pre.3328",
3
+ "version": "8.0.1-pre.3349",
4
4
  "license": "MPL-2.0",
5
5
  "description": "O3 Framework module for translation support",
6
6
  "type": "module",
@@ -27,7 +27,8 @@ const workspaceTranslations = {
27
27
  maximize: 'Maximize',
28
28
  minimize: 'Minimize',
29
29
  openAnyway: 'Open anyway',
30
- unsavedChangesInOpenedWorkspace: `You may have unsaved changes in the opened workspace. Do you want to discard these changes?`,
30
+ unsavedChangesInOpenedWorkspace:
31
+ 'You may have unsaved changes in the opened workspace. Do you want to discard these changes?',
31
32
  unsavedChangesInWorkspace:
32
33
  'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',
33
34
  unsavedChangesTitleText: 'Unsaved changes',
@@ -15,7 +15,7 @@
15
15
  "Clinic": "Clinic",
16
16
  "close": "Close",
17
17
  "closeAllOpenedWorkspaces": "Discard changes in {{count}} workspaces",
18
- "closingAllWorkspacesPromptBody": "There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
18
+ "closingAllWorkspacesPromptBody": "There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
19
19
  "closingAllWorkspacesPromptTitle": "You have unsaved changes",
20
20
  "confirm": "Confirm",
21
21
  "contactAdministratorIfIssuePersists": "Contact your system administrator if the problem persists.",
@@ -57,6 +57,7 @@
57
57
  "stateProvince": "State",
58
58
  "toggleDevTools": "Toggle dev tools",
59
59
  "unknown": "Unknown",
60
+ "unsavedChangesInOpenedWorkspace": "You may have unsaved changes in the opened workspace. Do you want to discard these changes?",
60
61
  "unsavedChangesInWorkspace": "There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.",
61
62
  "unsavedChangesTitleText": "Unsaved changes",
62
63
  "workspaceHeader": "Workspace header"
@@ -58,6 +58,6 @@
58
58
  "toggleDevTools": "Toggle dev tools",
59
59
  "unknown": "Inconnu",
60
60
  "unsavedChangesInWorkspace": "Il se peut que des modifications non enregistrées aient été apportées à « {{NomEspace}} ». Veuillez les enregistrer avant d'ouvrir un autre espace de travail.",
61
- "unsavedChangesTitleText": "Modifications non enregistrés",
61
+ "unsavedChangesTitleText": "Modifications non enregistrées",
62
62
  "workspaceHeader": "En-tête de l'espace de travail"
63
63
  }