phetsims / soccer-common

"Soccer Common" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 1 forks source link

images/africaModest does not follow the naming convention. #8

Open pixelzoom opened 5 months ago

pixelzoom commented 5 months ago

In soccer-common, I see:

images/africaModest

In all other sims with this region, I see:

images/africa-modest

Is there a naming convention that soccer-common (and hence CAV) is not following? This caused confusion when I was trying to help @amanda-phet set up images/ subdirectories for another sim.

marlitas commented 5 months ago

Fixed above. Thanks!

pixelzoom commented 4 months ago

Reopening.

I recommend changing the subdirectory names to camelcase, to match the tokens used in code. Here's why:

After digging deeper into this for https://github.com/phetsims/graphing-lines/issues/143, I discovered that the supported region tokens (currently in RegionAndCulturePortrayal) use camelcase:

export const USA_REGION_AND_CULTURE_ID = 'usa';
export const AFRICA_REGION_AND_CULTURE_ID = 'africa';
export const AFRICA_MODEST_REGION_AND_CULTURE_ID = 'africaModest';
export const ASIA_REGION_AND_CULTURE_ID = 'asia';
export const LATIN_AMERICA_REGION_AND_CULTURE_ID = 'latinAmerica';
export const OCEANIA_REGION_AND_CULTURE_ID = 'oceania';
export const MULTICULTURAL_REGION_AND_CULTURE_ID = 'multi';

But the subdirectory names use dash separators instead of camelcase: images/africa-modest, images/latin-america.

Besides the confusion factor, and the fact that there's no good reason for these naming conventions to be different... If PhET ever wants to automate discovery of images, or use grunt modulify to generate LocalizedImageProperty (analgous to LocalizedStringProperty), then life will be be a lot simpler if the same naming convention is used for tokens and directory names.