Localizing an application
How to localize SynergiWeb using the culture specified on the user
Localizing strings while developing
import { getLocalizedString } from "@olenbetong/appframe-core";
export function ComponentWithLocalizedString() {
return <div>{getLocalizedString("Please translate this text")}</div>;
}Formatting dates and numbers using the users culture
// Note that creating a formatter is a relatively expensive operation,
// and should be done outside of React components
let formatter = new Intl.DateTimeFormat(af.userSession.culture, {
year: "numeric",
month: "short",
date: "numeric"
});
function FormattedDate({ date }: { date: Date }) {
return <time>{formatter.format(date)}</time>
}Translations in Synergi
Last updated
Was this helpful?