Opened 4 years ago
Closed 7 months ago
#54086 closed defect (bug) (wontfix)
bloginfo language issue
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.0 |
| Component: | Networks and Sites | Keywords: | reporter-feedback |
| Focuses: | multisite | Cc: |
Description
hi,
the code snippet below only returns the name of the blog well, not the language, it is always the same.
even though the language is changed in the site admin settings.
<?php $sites = get_sites(); foreach ( $sites as $site ) { switch_to_blog( $site->blog_id ); echo get_bloginfo( 'name' ); echo get_bloginfo( 'language' ); restore_current_blog(); }
Change History (7)
#3
in reply to:
↑ 1
;
follow-up:
↓ 4
@
4 years ago
Replying to spacedmonkey:
Hello @kukac7, welcome to track.
language can be tricky to workout. determine_locale and get_locale are complex functions.
If you are looking for the site language, have you tried calling echo get_option( 'WPLANG' ); instead of echo get_bloginfo( 'language' ). This might work better in this context.
hi,
i have tried this now, but my problem is that in the general settings i have saved the language on the selected site, but with the network site settings the WPLANG field is empty on the selected site.
interesting.
and if i write in the WPLANG field, save, but it remains blank again.
#4
in reply to:
↑ 3
@
4 years ago
Replying to kukac7:
Replying to spacedmonkey:
Hello @kukac7, welcome to track.
language can be tricky to workout. determine_locale and get_locale are complex functions.
If you are looking for the site language, have you tried calling echo get_option( 'WPLANG' ); instead of echo get_bloginfo( 'language' ). This might work better in this context.
hi,
i have tried this now, but my problem is that in the general settings i have saved the language on the selected site, but with the network site settings the WPLANG field is empty on the selected site.
interesting.
and if i write in the WPLANG field, save, but it remains blank again.
very strange.
by default hu_HU is the language of the network.
if i set it to en_EN on one site, WPLANG is empty.
however, de_DE, the ru_RU language, works.
#5
@
4 years ago
@kukac7 my understanding is WPLANG is empty when the value is en_US. en_US seems to be the default and that may explain why the value is absent
Hello @kukac7, welcome to track.
language can be tricky to workout. determine_locale and get_locale are complex functions.
If you are looking for the site language, have you tried calling echo get_option( 'WPLANG' ); instead of echo get_bloginfo( 'language' ). This might work better in this context.