Language On Register

Started by Tokzu, September 02, 2014, 09:48:36 PM

Previous topic - Next topic

Tokzu

Link al mod

Language On Register v1.0
by Kaero Webs

Demo || Support Board || Online Manual || Changelog





Description
Language On Register (or LORegister) is a modification that allows the new users to select their prefered language when they register.




Compatibility
LORegister is compatible with SMF 2.0.X, any previous version is not supported.




Languages

       
  • English
  • English-utf8
  • Spanish
  • Spanish-utf8
  • Spanish_latin
  • Spanish_latin-utf8




Features

       
  • Use of integration hooks.
  • It can be disabled from administration.
  • The language field can be displayed on the "Required Information" or "Additional Information" section.
  • The language list have selected by default the default language on your forum.
  • If you have installed a language in its utf-8 and non-utf8 version, the mod will prioritize the utf8 version.




Changelog v1.0 (18/08/2014)
Legend: !Bugfix +New -Removed *Modified
* Initial release.






"I don't need a knight in a shinny armor, I need a angel in a trench coat"

My mods:

Ninja ZX-10RR

I can't manage to make the 2nd edit to this file successfully, it fails, I tried to edit it but I got a blank screen  O:) would you kindly help me please? :) The code to be added is this one:
Code (find, but there isn't anymore, maybe for updates idk) Select
echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';

// If we have either of these, show the extra group.


Code (add before) Select
if (!empty($modSettings['userLanguage']) && !empty($modSettings['loregister_show']) && $modSettings['loregister_show'] == 1)
{
loadlanguage('Profile');

echo '
<dl class="register_form" id="language_group">
<dt>
<strong><label for="lngfile">', $txt['preferred_language'], ':</label></strong>
</dt>
<dd>
<select id="lngfile" name="lngfile">';

if (empty($context['languages']))
getLanguages();

foreach ($context['languages'] as $key => $lang)
echo '
<option value="', $key, '" ', ($key == $language) ? 'selected="selected" ' : '', '>', str_replace('-utf8', '', $lang['name']), '</option>';

echo '
</select>
</dd>
</dl>';
}

Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Shambles

It's at line 268 of the file you submitted

Ninja ZX-10RR

..............................And then I realize that I posted the file I had edited to match the default theme and then again I realize that the mod works with the edited file... Ok, I need more sleep. Thanks Shambles for letting me know xD
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Shambles

So you owe me 45 seconds of my life.

I want it back now.

Right Now. I take paypal.

Ninja ZX-10RR

Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Apllicmz

Nice Work
when Update dont forget portuguese files

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>




Tokzu

Quote from: Joomlamz on November 09, 2014, 11:21:48 AM
Nice Work
when Update dont forget portuguese files

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['loregister_show'] = 'Solicite idioma no registo';
$txt['loregister_disabled'] = 'Desactivado';
$txt['loregister_required'] = 'Informa&ccedil;&otilde;es necess&aacute;rias na Sec&ccedil;&atilde;o';
$txt['loregister_additional'] = 'Informa&ccedil;&otilde;es adicionais na Sec&ccedil;&atilde;o';
]]></add>
        </operation>
    </file>



Thanks Joomlamz, I'll include it on the next update. ;D
"I don't need a knight in a shinny armor, I need a angel in a trench coat"

My mods:

Ninja ZX-10RR

#8
It would be quite cool to list the languages in alphabetical order, especially if there are many... I just realized that they are all ordered in a way that I can't understand.

EDIT: nvm I got it.
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Tokzu

Yes, the languages are in alphabetical order based on english language.
"I don't need a knight in a shinny armor, I need a angel in a trench coat"

My mods:

Ninja ZX-10RR

They weren't at all, actually. I had to add one more string (a ksort) to make them show up like that.
Ref: http://www.italiansmf.net/forum/index.php?topic=1231.0
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Tokzu

Oh, ok. I'll fix this on the next version. Thanks for appoint this. :D
"I don't need a knight in a shinny armor, I need a angel in a trench coat"

My mods:

Ninja ZX-10RR

Np :) oh btw to be clear I added the first string mentioned before the second mentioned in that topic, since it's italian it might have been unclear ;)

Yep it's good especially if you have all languages installed like me ;D
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Tokzu

Yeah, I don't understand italian but only for the code I interpretdd it has to be before the foreach. (the php coding is an universal language :P)
"I don't need a knight in a shinny armor, I need a angel in a trench coat"

My mods:

Advertisement: