Flags in Language Selector

I have a multilaguage project. Already changed Lanaguage Selector to “Dropdown”… usinlg $this->Type = “DROPDOWN”; in Language_Load.
I would love now to have Flags instead of “en” “es” (Or both)
also “english” and “spanish” instead of “en” “es” on mouse over… but that is secondary…

I have already de png of each language… but I can’t fond where change that…Any clue?

You may use Page_Foot server event in order to customize the language selector that suits your needs.Please read Server Events and Client Scripts topic from PHPMaker Help menu for more info and examples.

I’ll try, but there explain how to add a new item…
Not how to modify the language selector that already exists…

Try something like this:$(‘a[data-language]’).each(function() {
$(this).html(‘’);
});

It didn’t worked… I found the code into layout.php
At line 252…

<?= $Language->getTemplate() ?>

Done!
The code was perfect (I have to fix image folders only), but not in Page_footerClient Scripts
->Pages with header/footer
->Startup Script

FedeLopez wrote:

I found the code into layout.php

You may:

  1. Right click the page in your browser, select View page source (assume Chrome).
  2. Find above template (which is rendered by PHP so there is PHP code), copy it.
  3. Paste it in the generated layout.php above the original code (so it will be used instead of the original code)
  4. Customize your template, add your flags, etc., until it works in the browser as you want.
  5. Copy and paste the customized template (the tag) to Page_Foot (as mobhar wrote above), generate scripts again.

Adam wrote:

Try something like this:> $(‘a[data-language]’).each(function() {
$(this).html(‘’);
});

Explain: I have to rename the flags (Before es;en now es-ES;en-US) beacuse “…internationalization, the language ID of the language files must be a locale identifier using RFC 4646 language tags”… but the dropdown is broken… so I can´t select between engish/spanish anymoreIt was a Global Statup Script

$('a[data-language]').each(function() {
$(this).html('<img src="flags/' + $(this).data('language') + '.png" alt="" title="' + $(this).data('language') + '">');
});

You may press F12 in your browser and go to the Console and Network panel to find the error of your code.

Well… I get dropdown
In Language Load using
$this->Type = “DROPDOWN”;