L-variable with assign_block_vars isnt shown correctly

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
RobiX
Registered User
Posts: 89
Joined: Thu Oct 05, 2017 9:59 am

L-variable with assign_block_vars isnt shown correctly

Post by RobiX » Tue Nov 28, 2017 10:15 pm

I used Example #2 Nested blocks of page https://wiki.phpbb.com/Template.assign_block_vars.

I defined in common.php, e.g.,

Code: Select all

'WIKIPEDIA' => "Wikipedia",
instead of (see again in above URL)

Code: Select all

    'food'        => array(
        'banana',
        'apple',
        'pie',
        'ice-cream',
    ),
i used

Code: Select all

    'food'        => array(
        "{L_WIKIPEDIA}",
        '{L_WIKIPEDIA}',
        "L_WIKIPEDIA",
        'L_WIKIPEDIA',
    ),
all of them are displayed in

Code: Select all

{block1.block2.ITEM}
as, e.g.,

Code: Select all

{L_WIKIPEDIA}
but not translated (wrong)
if i write

Code: Select all

{L_WIKIPEDIA}
manually, it is translated (correct)

so i guess another replacing process is necessary for translation

but how can I solve it?

User avatar
AmigoJack
Registered User
Posts: 5154
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: L-variable with assign_block_vars isnt shown correctly

Post by AmigoJack » Wed Nov 29, 2017 8:18 am

Template placeholders are automatically tried to be substituted with language constants, even when they miss the L_ prefix. Assigning values to placeholders in your script is another story. If you haven't looked at an existing file (such as /viewtopic.php) how it is done there then have a look at Docs » Languages and translations » Using the Language System.
The worst thing about censorship is ███████████

RobiX
Registered User
Posts: 89
Joined: Thu Oct 05, 2017 9:59 am

Re: L-variable with assign_block_vars isnt shown correctly

Post by RobiX » Wed Nov 29, 2017 8:35 pm

thank you

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 4 guests