I have made some changes to template files for translations to member ranks and i would like you to see the sample code if it is safe.
viewtopic_body.htmlI use the exact same one in other templates, with the difference that there are no images where they are not required.
Below i give a sample from the new version of the board3 extension that i adapted
user_menu_side.htmlIt's not automated, but it works fine.
viewtopic_body.html
Code:
<!-- IF postrow.RANK_TITLE == 'Administrators' --> <span class="rank-title">{L_RANK_ADMINISTRATORS}</span> <img src="./images/ranks/administrator.png" alt="{L_RANK_ADMINISTRATORS}" title="{L_RANK_ADMINISTRATORS}"> <!-- ELSEIF postrow.RANK_TITLE == 'VIP' --> <span class="rank-title">{L_RANK_VIP}</span> <img src="./images/ranks/vip.png" alt="{L_RANK_VIP}" title="{L_RANK_VIP}"> <!-- ELSEIF postrow.RANK_TITLE == 'Moderators' --> <span class="rank-title">{L_RANK_MODERATORS}</span> <img src="./images/ranks/moderator.png" alt="{L_RANK_MODERATORS}" title="{L_RANK_MODERATORS}"> <!-- ELSEIF postrow.RANK_TITLE == 'Designer' --> <span class="rank-title">{L_RANK_DESIGNER}</span> <img src="./images/ranks/designer.png" alt="{L_RANK_DESIGNER}" title="{L_RANK_DESIGNER}"> <!-- ELSEIF postrow.RANK_TITLE == 'Deleted Members' --> <span class="rank-title">{L_RANK_DELETED_MEMBERS}</span> <img src="./images/ranks/banned.png" alt="{L_RANK_DELETED_MEMBERS}" title="{L_RANK_DELETED_MEMBERS}"> <!-- ELSEIF postrow.RANK_TITLE == 'Registered' --> <span class="rank-title">{L_RANK_REGISTERED}</span> <img src="./images/ranks/member.png" alt="{L_RANK_REGISTERED}" title="{L_RANK_REGISTERED}"> <!-- ELSEIF postrow.RANK_TITLE == 'New Members' --> <span class="rank-title">{L_RANK_NEW_MEMBERS}</span> <img src="./images/ranks/new-member.png" alt="{L_RANK_NEW_MEMBERS}" title="{L_RANK_NEW_MEMBERS}"> <!-- ELSE --> {# If there is no translated value, display the original title and image #} <span class="rank-title">{postrow.RANK_TITLE}</span> {postrow.RANK_IMG} <!-- ENDIF --></dd>
Below i give a sample from the new version of the board3 extension that i adapted
user_menu_side.html
Code:
{% if B3P_RANK_TITLE == 'Administrators' %} {{ lang('RANK_ADMINISTRATORS') }} <br /><img src="{{ ROOT_PATH }}images/ranks/administrator.png" alt="{{ lang('RANK_ADMINISTRATORS') }}" title="{{ lang('RANK_ADMINISTRATORS') }}"> {% elseif B3P_RANK_TITLE == 'VIP' %} {{ lang('RANK_VIP') }} <br /><img src="{{ ROOT_PATH }}images/ranks/vip.png" alt="{{ lang('RANK_VIP') }}" title="{{ lang('RANK_VIP') }}"> {% elseif B3P_RANK_TITLE == 'Moderators' %} {{ lang('RANK_MODERATORS') }} <br /><img src="{{ ROOT_PATH }}images/ranks/moderator.png" alt="{{ lang('RANK_MODERATORS') }}" title="{{ lang('RANK_MODERATORS') }}"> {% elseif B3P_RANK_TITLE == 'Designer' %} {{ lang('RANK_DESIGNER') }} <br /><img src="{{ ROOT_PATH }}images/ranks/designer.png" alt="{{ lang('RANK_DESIGNER') }}" title="{{ lang('RANK_DESIGNER') }}"> {% elseif B3P_RANK_TITLE == 'Deleted Members' %} {{ lang('RANK_DELETED_MEMBERS') }} <br /><img src="{{ ROOT_PATH }}images/ranks/banned.png" alt="{{ lang('RANK_DELETED_MEMBERS') }}" title="{{ lang('RANK_DELETED_MEMBERS') }}"> {% elseif B3P_RANK_TITLE == 'Registered' %} {{ lang('RANK_REGISTERED') }} <br /><img src="{{ ROOT_PATH }}images/ranks/member.png" alt="{{ lang('RANK_REGISTERED') }}" title="{{ lang('RANK_REGISTERED') }}"> {% elseif B3P_RANK_TITLE == 'New Members' %} {{ lang('RANK_NEW_MEMBERS') }} <br /><img src="{{ ROOT_PATH }}images/ranks/new-member.png" alt="{{ lang('RANK_NEW_MEMBERS') }}" title="{{ lang('RANK_NEW_MEMBERS') }}"> {% else %} {{ B3P_RANK_TITLE }} {% if B3P_RANK_IMG %} <br />{{ B3P_RANK_IMG }} {% endif %} {% endif %} </span>{% endif %}
Statistics: Posted by loukas79 — Thu May 01, 2025 6:39 pm