Skip to content

[Question]: Changing Labels in System #153

Closed

Description

@Brownjv

What would you like to know?

Is there a way to change the labels such as "state" to for instance "province" etc, Im aware of the translations section and I have gone ahead and changed two labels, however when going to create a new incident under the location tab it has a dropdown with a list of states. TIA for any help

Which version are you running?

4.2.29

How is it installed?

Docker (docker compose)

What have you tried so far?

No response

Activity

  1. ejosterberg commented on Oct 16, 2026

    @ejosterberg
    Member

    Thanks for the clear question. The label and the list are two separate things:

    • The label ("State") is the caption form.state in Settings → Translations, which you've already found. That is what the New Incident form's Location section shows.
    • The list in that dropdown comes from a database table, states_translator, which is filled with U.S. states at install. Every State dropdown in the program (incidents, members, units, facilities and the rest) reads that same table, so whatever you put there appears everywhere. There isn't a screen for editing it yet, so for now it is a database change.

    On a Docker install, take a backup first (Settings → Backup / Maintenance), then open the database:

    docker compose exec db mariadb -u newui -p newui
    

    The password is NEWUI_DB_PASS from your .env (if you changed NEWUI_DB_USER or NEWUI_DB_NAME there, use those instead of newui).

    To add provinces, for example Canada's provinces and territories:

    INSERT INTO states_translator (name, code) VALUES
      ('Alberta','AB'), ('British Columbia','BC'), ('Manitoba','MB'), ('New Brunswick','NB'),
      ('Newfoundland and Labrador','NL'), ('Northwest Territories','NT'), ('Nova Scotia','NS'),
      ('Nunavut','NU'), ('Ontario','ON'), ('Prince Edward Island','PE'), ('Quebec','QC'),
      ('Saskatchewan','SK'), ('Yukon','YT');

    To see the list and remove the rows you don't want:

    SELECT id, code, name FROM states_translator ORDER BY name;
    DELETE FROM states_translator WHERE code IN ('AL', 'AK');   -- the codes you want gone

    Codes can be up to 4 characters. A record that already has a state saved keeps it: a saved value that is no longer in the list is still shown on that record. Reload the page after the change, because the list is read when a page opens.

  2. ejosterberg commented on Oct 19, 2026

    @ejosterberg
    Member

    There is now a screen for this list, on main in this repository: Settings → Application — Geographic Data → States / Provinces (it needs the "Manage configuration" permission).

    • Edit the list directly. Add, rename or delete entries. Before a delete it shows how many saved records use that code; saved records are never changed.
    • Configuration wizard. Built-in lists for the United States (48 or 50, with options for DC, the territories, the armed-forces codes and the freely associated states), Canada, Mexico, Australia, New Zealand, the United Kingdom, Ireland, Germany, Brazil and India, plus one-click combinations such as "US + Canada". You choose whether to replace the current list or add to it, see a preview first (including how many saved records use any code being removed), and can rename the field label at the end, for example to "Province".
    • Import and export as CSV (code,name). Each built-in list can also be downloaded as a CSV to edit and re-import, which covers places the built-in lists don't.
    • Accented names (Michoacán, Manawatū-Whanganui) now store correctly.

    For your case: run the wizard, choose Canada and "Replace the list", and on the last step set the label to "Province". The New Incident address lookup also fills the province from a Canadian address now.

    On Docker it arrives with an update: git pull && docker compose up -d --build (the container applies the database changes when it starts). Details are in docs/STATES-AND-PROVINCES.md.

    Please try it and comment here with anything that doesn't work the way you need. If it covers what you asked, close the issue.

  3. Brownjv commented on Oct 19, 2026

    @Brownjv
    Author

    Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions