Skip to content

Commit

Permalink
Wrapping localeModuleInfo localizedName with proper embedding marks, …
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Feb 22, 2023
1 parent 2eb0988 commit 286bf32
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/preferences/LanguageSelectionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import joist from '../joist.js';
import { Color, FireListener, HighlightOverlay, Rectangle, Text } from '../../../scenery/js/imports.js';
import localeInfoModule from '../../../chipper/js/data/localeInfoModule.js';
import Tandem from '../../../tandem/js/Tandem.js';
import PreferencesDialog from './PreferencesDialog.js';
import PhetColorScheme from '../../../scenery-phet/js/PhetColorScheme.js';
import Property from '../../../axon/js/Property.js';
import { Locale } from '../i18n/localeProperty.js';
import StringUtils from '../../../phetcommon/js/util/StringUtils.js';

export default class LanguageSelectionNode extends Rectangle {

Expand All @@ -23,10 +23,13 @@ export default class LanguageSelectionNode extends Rectangle {

public constructor( localeProperty: Property<Locale>, locale: Locale ) {

// Wrap it with embedding marks to ensure it displays correctly, see https://github.com/phetsims/chipper/issues/1379
const wrappedLocaleString = StringUtils.localeToLocalizedName( locale );

// Include the locale code when running with ?dev.
const string = phet.chipper.queryParameters.dev ?
`${localeInfoModule[ locale ].localizedName} (${locale})` :
localeInfoModule[ locale ].localizedName;
StringUtils.wrapLTR( `${wrappedLocaleString} (${locale})` ) :
wrappedLocaleString;

const text = new Text( string, {
font: PreferencesDialog.CONTENT_FONT
Expand Down

0 comments on commit 286bf32

Please sign in to comment.