Skip to content

Commit

Permalink
Rename second getString parameter to vars
Browse files Browse the repository at this point in the history
It's equivalent to the `vars` prop on <Localiszed> and the
respective parameter for getElement, holding Fluent variables.
  • Loading branch information
Vinnl committed Sep 12, 2022
1 parent 6027f43 commit f2b728c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fluent-react/src/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ export class ReactLocalization {

getString(
id: string,
args?: Record<string, FluentVariable> | null,
vars?: Record<string, FluentVariable> | null,
fallback?: string
): string {
const bundle = this.getBundle(id);
if (bundle) {
const msg = bundle.getMessage(id);
if (msg && msg.value) {
let errors: Array<Error> = [];
let value = bundle.formatPattern(msg.value, args, errors);
let value = bundle.formatPattern(msg.value, vars, errors);
for (let error of errors) {
this.reportError(error);
}
Expand Down

0 comments on commit f2b728c

Please sign in to comment.