Localized image in staticDir2 works on localhost but not in build

Background: I have a multi-host multilingual site. English and Japanese, each built to their own GitHub Pages repo.

I set up separate static directories to support localized images.

The Issue: The localized images are displayed correctly in localhost, but when I build the site, the default English image is used on the Japanese site.

The Setup: Here is some info about the setup:

Directory structure:

├── archetypes
├── bin
├── config
├── content
├── public
├── resources
├── static
├── static_en
├── static_ja
└── themes

Here are the two images:

static_ja
└── images
    └── icons
        └── logo.svg
static_en
└── images
    └── icons
        └── logo.svg

Here is the config structure:

config
├── _default
│   ├── config.toml
│   ├── languages.toml
│   └── menus
│       ├── config.en.toml
│       └── config.ja.toml
├── development
│   ├── config.toml
│   └── languages.toml
└── production
    └── config.toml

The global setting is in config/_default/config.toml:

staticDir = "static"

The localized settings are in config/_default/languages.toml:

[en]
contentDir = "content/en"
languageName = "English"
weight = 1
title = "Site Name EN"
baseurl = "https://example.com/"
staticDir2 = "static_en"

[ja]
contentDir = "content/ja"
languageName = "日本語"
weight = 2
title = "Site Name JA"
baseurl = "https://example.co.jp"
staticDir2 = "static_ja"

Can you think of what would cause the English image to be used in the built Japanese site?

Can you share the repository so that we can (1) reproduce the issue, (2) see the content, and (3) see the other configuration files?

@jmooring Unfortunately, it’s all private. I tried to provide as much relevant info as I could. I was hoping someone might have ideas on what would cause the discrepancy in behavior between localhost and the built site.

Can you clone it, remove the sensitive content, create dummy content, reproduce the problem, and then share the new repository? Your chances of getting assistance on this forum will increase dramatically, and the time to resolution will decrease.