iridl / python-maprooms

Dash maprooms and tools
0 stars 4 forks source link

Be human-language dependent-ready #297

Open remicousin opened 1 year ago

remicousin commented 1 year ago

Make sure that what would some day needs to be translated is not used by the code. Typical example below for select menus values (used by code) vs labels (displayed to user).

          I haven't traced through the code to see if this is actually the case, but I have a feeling this might break when we translate menu items into another language, or rename menu items (e.g. "ENACTS rainfall"). Menu items have display names that are distinct from the id so that you can change the display name without changing the id. Make sure program logic uses the id, not the display name.

_Originally posted by @aaron-kaplan in https://github.com/iridl/python-maprooms/pull/292#discussion_r1137083489_

remicousin commented 1 year ago

Other example where language and code are intertwined presently:

dbc.Label("Latitude", style={"font-size": "80%"}), dbc.Tooltip( f"{lat_label}", target="lat_input", className="tooltiptext", )]),

Latitude is in English (and French -- but not Spanish). lat_label is in English.

This being said, the whole Pick a Point control should probably be black-boxed and thus I am not sure where exactly the multi-language functionality will intervene.