Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔖 [PR] New default label options and translations #1065

Commits on Oct 12, 2023

  1. Adding default label-options

    confirmHelper.ts
    - Removed archaic behavior or using old Angular i18nUtils module to get the filename of the translations' trip_confirm_options.json file
    - The "else" default "no label_options found in config" behavior is almost identical to the if(appConfig.label_options), but it just uses the default label options URL at label-options.json.sample
    - Pulled the language-specific text handling behavior out of the if statement, because either way (label_options or no label_options) the JSON data model will look the same
    - The for loop for filling in the translatied text for label-options checks 1. The label-options file first, then 2. The i18next file for the translation
    
    label-options.json.sample
    - Created new file
    - Replaces trip_confirm_options.json.sample (this location in confirmHelper.ts was the only place in the codebase using this file)
    - Modeled after https://github.com/e-mission/nrel-openpath-deploy-configs/blob/main/label_options/example-program-label-options.json
    - Only has translations for EN and ES
    
    trip_confirm_options.json.sample
    - Removed this file
    sebastianbarry committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    37be426 View commit details
    Browse the repository at this point in the history
  2. Adding examples of multilabel translations to en.json

    en.json
    - Added multilabel filed filled with a few multilabel translations in EN
    sebastianbarry committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    6508517 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. Correct text in comment

    > JGreenlee 
    > It's the other way around. labelOptions first, then i18next.
    > The code is correct but the comment is not
    sebastianbarry authored Oct 17, 2023
    Configuration menu
    Copy the full SHA
    36b56da View commit details
    Browse the repository at this point in the history
  2. Adding spaces between slashes in text

    > JGreenlee
    > While we are rewriting and have this opportunity, can we make all the text with slashes look "like / this" instead of "like/ this"?
    > I believe they were made like that a while ago to force a line break. But we don't do that anymore in the UI so the slashes end up looking weird.
    sebastianbarry committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    202f6db View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1bb9055 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. Remove translations from label-options.json.sample

    Since the default translations are in 18next files, we don't need a duplicate of the default label options translations in this file
    
    Also changed the logic because I didn't have it right when labelOptions.translations is undefined
    sebastianbarry committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    2c6739a View commit details
    Browse the repository at this point in the history