Making String.json Populate Config_Flow Integration UI

I’m working on a component that I want to integrate with the new UI configuration method. I know that this only works for builtin components so I forked the HA repo and built a test environment. I ran python -m script.hassfest to populate the config flow entries and script/setup. In the component I have config_flow: true in manifest.json and the following strings.json file:

{
  "config": {
    "title": "VeSync",
    "step": {
      "user": {
        "title": "Fill in your information",
        "data": {
          "username": "Email Address",
          "password": "Password",
          "time_zone": "Set custom time zone (optional)"
        }
      }
    },
    "error": {
      "identifier_exists": "Account already registered",
      "invalid_credentials": "Invalid credentials"
    }
  }
}

The problem is when I click on add integration, it shows up as a blank entry on the top of the list. When I click on add, the correct user form shows up but there is no description or text in any of the lines. I enter the login info and click submit and the component sets up (at least to the point where I know it has a bug). Is there something I’m missing to make the strings.json populate the UI fields?

This is the folder in my fork with the component I’m working on: https://github.com/webdjoe/home-assistant/tree/dev/homeassistant/components/vesync

Any help would be appreciated!

1 Like

I think you need to make a copy of strings.json in a .translations folder you need to create and name the copy en.json.

2 Likes

Hi,

I have the same issue with my “onewire” component.
I ran “python3.8 -m script.translations develop --integration onewire”, and this created a new folder in my component directory: homeassistant/components/onewire/translations/en.json

However my config_flow UI is still not populating.

My fork is here:

1 Like

Similar issue here…
Can someone help on how to to get the UI populated with the correct strings?
Thanks

Oh, I had it working once I spelled “translations” correctly, :grin:

I’d like to ask why this is needed.
We need to have two files with the exact same content, but why??? :man_shrugging:
I only created a couple of integrations and right now I’m trying to move them to config flow, so I’m trying to understand everything.
If we need en.json in the translations folder anyway, so we should be able to remove strings.json.
At least in theory :slight_smile:

2 Likes

Man took me a while to figure this out…agreed!

1 Like

same here, you have a good example here : example-custom-config/custom_components/detailed_hello_world_push at master · home-assistant/example-custom-config · GitHub