.resx translated file names for GitHub Actions

I’m trying to set up GitHub integration with Crowdin in with my WPF project. The files have names in these formats:

CommonRes.bs.resx
CommonRes.de.resx
CommonRes.es.resx
CommonRes.hr.resx
CommonRes.pt.resx
CommonRes.pt-BR.resx
CommonRes.zh-Hans.resx
CommonRes.zh-Hant.resx

I’m trying to set up the file name format in crowdin.yml. %osx_code% is the closest to what I need, but it tacks on “lproj” to the end:

CommonRes.bs.lproj.resx
CommonRes.de.lproj.resx
CommonRes.es.lproj.resx
CommonRes.hr.lproj.resx
CommonRes.pt.lproj.resx
CommonRes.pt-BR.lproj.resx
CommonRes.zh-Hans.lproj.resx
CommonRes.zh-Hant.lproj.resx

Using %locale% almost works, but it uses “.bs-BA.resx”, which is not recognized as a valid culture code. %osx_locale% is close to working, but uses an underscore for pt_BR, which is not valid naming for resx.

It would be nice to have a placeholder that produces an appropriate string for use in .resx files as per XML Resources | Microsoft Learn .

Failing that, does anyone have an example of a script or some workaround to do some automatic renaming in GitHub actions?

Hey @RandomEngy,

You can use the Language mapping option to properly configure the display of language codes in file names

1 Like

That’s perfect! Thanks for the quick help.