-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with languages with suffixes (ex. de_DE_formal) or single-word (ex. af) #50
Comments
Alternatively it might be a good idea to prefix the languages. Ex.: |
Hi @constip, thx for the issue. To answer your both remarks :
Finally, to to be sure, are you facing any bug ? |
@MaximeCulea yes. The problem is I use the language I have only tested this with options-pages but my first solution seemed to work there... |
Hi I realize this is quite old issue, but especially concerning the latest updates in ACF, this is still relevant. ACF 5.11.2 introduced the following change: "get_field() and the_field() functions now are only able to access site options which are ACF fields" This causes problems with languages that doesn't follow the standard language_COUNTRY -convention in locale. For example in our case Finnish locale is just For example we have one site with three languages (fi, sv_SE and en_GB). Also we have set the data only in …&lang=all -page. So the fields in …&lang=fi, …&lang=sv and …&lang=en -pages are empty. Even though the fix was quite easy in our case, I think this bug should be fixed in the plugin. It can cause problems in the future, since the regex is so selective for the format of locale. Polylang has the list of different locales, so maybe you can use that one instead of |
We have noticed that Options are not properly retrieved in certain languages and I am confident I have narrowed it down to this line:
$_post_id = preg_replace( '/(_[a-z]{2}_[A-Z]{2})/', '', $post_id );
in
classes/main.php#61
BEA\ACF_Options_For_Polylang\Main::get_default_reference
Updating the regex to
sprintf( '/(_%s)/', pll_current_language( 'locale' ) )
should do the trick. This properly removes the current language, however it also means that the default can only be reached from the current language which might not be ideal...The text was updated successfully, but these errors were encountered: