michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
339 stars 71 forks source link

Plugin is not working in french? #276

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello,

I'm evaluating admin-page-framework for my project. Seems to be extremely well done so far! I'll probably stay in the basic scenarios but even for that it seem more promising than a adhoc in-house solution.

The only problem I have found so far it that it looks like the demo is not displaying french text where I would expect it (I see that there are a few untranslated strings in fr_FR files but I'm not sure it's related).

I understand that the plugin loader domain is not translated but it looks like the fields themselves are not translated, I would have expected that to be core (and maybe even from WordPress core?).

I traced the code and it looked like the plugin was trying to load the file from wp-content/languages/plugin so I moved the files there and it looks like they are loaded in Wordpress.

The exemple is the image selection, the button display "Select image" in english, I would expect it to be in french.

Is there anything that I should be aware or that I could check?

I'll continue my investigation to see if I can figure it out by myself!

ghost commented 6 years ago

Oh, I think I understand, the text is defined in "loader" domain, I would have expected some defaults from the framework....

$oFactory->addSettingFields(
$this->sSectionID, array( 'field_id' => 'image_select_field', 'title' => __( 'Select an Image', 'admin-page-framework-loader' ),

michaeluno commented 6 years ago

Hi,

There are two major components. One is Admin Page Framework and the other is the loader plugin that loads the framework and includes demo. The former uses the text domain "admin-page-framework" and the latter uses "admin-page-framework-loader". And yes, there are many untranslated items.

When you generate your own version of the framework, you are going to set your own text domain. This way, you can let POEdit to parse the generated framework files to find translatable items under your text domain.

ghost commented 6 years ago

Thanks for the follow-up. You can close the issue!