which-dialect 0.5.10 → 0.5.11

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.
@@ -109,8 +109,9 @@ export function createPhrasebook(options = {}) {
109
109
  if (last < frame.text.length)
110
110
  parts.push({ text: frame.text.slice(last), kind: 'fixed' });
111
111
  let text = tidy(parts.map((p) => p.text).join(''));
112
+ // The first letter, after any opening mark (Spanish "¿quieres…" → "¿Quieres…").
112
113
  if (!frame.clause)
113
- text = text.charAt(0).toUpperCase() + text.slice(1);
114
+ text = text.replace(/^([¿¡]?)(\p{L})/u, (_, mark, c) => mark + c.toUpperCase());
114
115
  const slots = Object.entries(frame.slots).map(([name, pos]) => ({ name, pos }));
115
116
  const en = Object.keys(frame.slots).reduce((s, name) => (typeof values[name] === 'string' ? s.replace(`{${name}}`, values[name]) : s), frame.en[0]);
116
117
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "which-dialect",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "Translate words between languages and dialects, meaning by meaning, starting with Vietnamese (Northern, Central, Southern), Spanish (by country) and English, with Wiktionary data loaded on demand. More languages are planned.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",