Skip to content

Commit

Permalink
move localizedStrings to separate file, #1550 scenerystack/scenerysta…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 3, 2025
1 parent 53fcbbb commit 0162b3c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/browser/LocalizedString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import arrayRemove from '../../../phet-core/js/arrayRemove.js';
import { PhetioID } from '../../../tandem/js/phet-io-types.js';
import Tandem from '../../../tandem/js/Tandem.js';
import chipper from './chipper.js';
import { localizedStrings } from './getStringModule.js';
import LocalizedStringProperty from './LocalizedStringProperty.js';
import localizedStrings from './localizedStrings.js';

// constants
const FALLBACK_LOCALE = 'en';
Expand Down
4 changes: 1 addition & 3 deletions js/browser/getStringModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ import Tandem from '../../../tandem/js/Tandem.js';
import IOType from '../../../tandem/js/types/IOType.js';
import ObjectLiteralIO from '../../../tandem/js/types/ObjectLiteralIO.js';
import LocalizedString, { LocalizedStringStateDelta, StringsStateStateObject } from './LocalizedString.js';
import localizedStrings from './localizedStrings.js';

// constants
const FALLBACK_LOCALE = 'en';

// Holds all of our localizedStrings, so that we can save our phet-io string change state
export const localizedStrings: LocalizedString[] = [];

// For developer internal use, particularly for memory leak detection
// e.g. _.max( phet.chipper.localizedStrings.map( ls => ls.property.tinyProperty.listeners.size ) ) to see if there is
// likely a leak
Expand Down
13 changes: 13 additions & 0 deletions js/browser/localizedStrings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2025, University of Colorado Boulder

/**
* Holds all of our localizedStrings, so that we can save our phet-io string change state, and update manually during stringTest=dynamic
*
* @author Jonathan Olson <jonathan.olson>
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import type LocalizedString from './LocalizedString.js';

const localizedStrings: LocalizedString[] = [];
export default localizedStrings;

0 comments on commit 0162b3c

Please sign in to comment.