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
RobiX
Registered User
Posts: 118
Joined: Thu Oct 05, 2017 9:59 am

L-variable with assign_block_vars isnt shown correctly

Post by RobiX »

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?
rob.ec - Connect. Discuss. Learn.
forum with scripts/tools

sitemap of the scripts: sitemap
User avatar
AmigoJack
Registered User
Posts: 6116
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: L-variable with assign_block_vars isnt shown correctly

Post by AmigoJack »

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 problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
RobiX
Registered User
Posts: 118
Joined: Thu Oct 05, 2017 9:59 am

Re: L-variable with assign_block_vars isnt shown correctly

Post by RobiX »

thank you
rob.ec - Connect. Discuss. Learn.
forum with scripts/tools

sitemap of the scripts: sitemap

Return to “phpBB Custom Coding”