Skip to content

Commit 14320fc

Browse files
Copilothotlong
andcommitted
fix: address code review feedback on error messages and comments
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0b3b0e6 commit 14320fc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/core/src/fallbacks/memory-i18n.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function createMemoryI18n() {
3535
const value = data ? resolveKey(data, key) : undefined;
3636
if (value == null) return key;
3737
if (!params) return value;
38+
// Interpolation format: {{paramName}} — matches FileI18nAdapter convention
3839
return value.replace(/\{\{(\w+)\}\}/g, (_, name) => String(params[name] ?? `{{${name}}}`));
3940
},
4041

packages/rest/src/rest-server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ export class RestServer {
695695
const locales = await this.protocol.getLocales({});
696696
res.json(locales);
697697
} else {
698-
res.status(501).json({ error: 'i18n locales not supported by protocol implementation' });
698+
res.status(501).json({ error: 'i18n service not available in protocol' });
699699
}
700700
} catch (error: any) {
701701
res.status(500).json({ error: error.message });
@@ -717,7 +717,7 @@ export class RestServer {
717717
const translations = await this.protocol.getTranslations({ locale: req.params.locale });
718718
res.json(translations);
719719
} else {
720-
res.status(501).json({ error: 'i18n translations not supported by protocol implementation' });
720+
res.status(501).json({ error: 'i18n service not available in protocol' });
721721
}
722722
} catch (error: any) {
723723
res.status(500).json({ error: error.message });

0 commit comments

Comments
 (0)