Skip to main content
Topic: some issues with text hardcoded in template files (Read 3628 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

some issues with text hardcoded in template files

I'm done with my translation. Yay!  :D

But: In some template files some punctuation marks are hardcoded and can not be find in the language files. This leads to an unconsistent appearance in the user profile. Here's an example of ProfileOptions.template.php:

Code: [Select]
<strong>', $txt['primary_membergroup'], ': </strong><br />

The ":" after the text string should be part of the string ElkArte takes out of the language file! Because some fields in the profile have now a ":" and some not, but this can't be repaired in the language files. See the attachment please.

So please, rewrite these template files!

Re: some issues with text hardcoded in template files

Reply #1

Yes, that should be done for 1.1, for sure.
Do it at this moment can lead to inconsistencies in other places because strings may be reused. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: some issues with text hardcoded in template files

Reply #2

Really? If this is not planned for 1.0 I will give it a try and fix this for myself anyway. No hard feelings but many of my members look into their profile a lot and I want to offer them the best experience possible. 

Re: some issues with text hardcoded in template files

Reply #3

If you need any hint/help feel free to ask. ;D
And of course, if when you have finished, you want to share your changes, you are welcome! 8)
Bugs creator.
Features destroyer.
Template killer.

Re: some issues with text hardcoded in template files

Reply #4

No help needed, did it already. But thanks!  :)

All changes must be made in only ProfileOptions.template.php. I can tell all the exact positions and what to replace if anyone wants to do this as well. If not, I spare me this work.  ;)

Re: some issues with text hardcoded in template files

Reply #5

Quote from: emanuele – And of course, if when you have finished, you want to share your changes, you are welcome! 8)

Okay, here are the changes to get rid of all the colons in the template file:

In ProfileOptions.template.php search for:

Code: [Select]
							<strong>', $field['name'], ': </strong><br />

Replace with:

Code: [Select]
							<strong>', $field['name'], '</strong><br />

Search for:

Code: [Select]
							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br />

Replace with:

Code: [Select]
							<strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ' </label></strong><br />

Search for:

Code: [Select]
								<label for="pm_settings">', $txt['pm_display_mode'], ':</label>

Replace with:

Code: [Select]
								<label for="pm_settings">', $txt['pm_display_mode'], '</label>

Search for:

Code: [Select]
								<label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>

Replace with:

Code: [Select]
								<label for="calendar_start_day">', $txt['calendar_start_day'], '</label>

Search for:

Code: [Select]
							<label for="notify_regularity">', $txt['notify_regularity'], ':</label>

Replace with:

Code: [Select]
							<label for="notify_regularity">', $txt['notify_regularity'], '</label>

Search for:

Code: [Select]
							<label for="notify_types">', $txt['notify_send_types'], ':</label>

Replace with:

Code: [Select]
							<label for="notify_types">', $txt['notify_send_types'], '</label>

Search for:

Code: [Select]
								<strong>', $txt['primary_membergroup'], ': </strong><br />

Replace with:

Code: [Select]
								<strong>', $txt['primary_membergroup'], ' </strong><br />

Search for:

Code: [Select]
								<strong>', $txt['additional_membergroups'], ':</strong>

Replace with:

Code: [Select]
								<strong>', $txt['additional_membergroups'], '</strong>

Search for:

Code: [Select]
								<strong>', $txt['dob'], ':</strong><br />

Replace with:

Code: [Select]
								<strong>', $txt['dob'], '</strong><br />

Search for:

Code: [Select]
								<strong>', $txt['signature'], ':</strong><br />

Replace with:

Code: [Select]
								<strong>', $txt['signature'], '</strong><br />

Search for:

Code: [Select]
								<strong><label for="easyformat">', $txt['time_format'], ':</label></strong><br />

Replace with:

Code: [Select]
								<strong><label for="easyformat">', $txt['time_format'], '</label></strong><br />

Search for:

Code: [Select]
								<strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '><label for="time_offset">', $txt['time_offset'], ':</label></strong><br />

Replace with:

Code: [Select]
								<strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '><label for="time_offset">', $txt['time_offset'], '</label></strong><br />

Search for:

Code: [Select]
								<strong>', $txt['current_theme'], ':</strong>

Replace with:

Code: [Select]
								<strong>', $txt['current_theme'], '</strong>

If you want colons in the profile you must add them now to the language file Profile.language.php.

Re: some issues with text hardcoded in template files

Reply #6

@emanuele Here's the file if you wanna use it for RC2 and final. There seem to be no inconsistencies at first sight.

Re: some issues with text hardcoded in template files

Reply #7

Seems like this should be added for RC2 as well ?

Re: some issues with text hardcoded in template files

Reply #8

I guess so, I probably misunderstood, I thought you wanted to have the colons, but more them to the language files, that would potentially cause problems if strings are used elsewhere (as they likely are), but remove colons should be safe enough. :)
Bugs creator.
Features destroyer.
Template killer.

Re: some issues with text hardcoded in template files

Reply #9

If all happens in the language files and not in the template files every admin can decide for himself if he wants to use colons or not. He simply has to edit the language files then. I think this ist the best and cleanest way.

Re: some issues with text hardcoded in template files

Reply #10

I'll get this added to my pending PR  :)
Last Edit: July 19, 2014, 08:31:19 am by Spuds

Re: some issues with text hardcoded in template files

Reply #11

Okay!
Then I'll wait merging the PR until then. ;D
Bugs creator.
Features destroyer.
Template killer.

Re: some issues with text hardcoded in template files

Reply #12

Done (plus some additional template cleanup)  O:-)    ...   Need to look at the who's online one for this PR as well

Re: some issues with text hardcoded in template files

Reply #13

So it's ready for RC2? O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: some issues with text hardcoded in template files

Reply #14

Probably yes! ... have you looked at the site error log ?   I forgot to last time I was in the ACP  :-[