-
AuthorPosts
-
jooservices Friend
jooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
April 13, 2015 at 2:33 am #205479In Teline at right-top we have header calendar. It’s nice but somehow it’s missed translate able because hard code here.
In this topic we’ll find out how to solve it.At first with browser debugger we can inspect this html and use it to search string and locate layout file
<div class="col-inner">
<span class="number date">13</span>
<div class="text">
<span class="day">Mon</span>, <span class="month">Apr</span>
</div>
</div>It’s located in:templatesja_teline_vtplsblocksheader.php.
<div class="col calendar">
<div class="col-inner">
<span class="number date"><?php echo date('d') ?></span>
<div class="text">
<span class="day"><?php echo date('D') ?></span>, <span class="month"><?php echo date('M') ?></span>
</div>
</div>
</div>It should be use Joomla! API to get date here. But somehow developer lost it. Now we need to solve it.
What’s date return ?http://php.net/manual/en/function.date.php
date(‘d’) will return
<blockquote>d Day of the month, 2 digits with leading zeros 01 to 31</blockquote>
No need to translate number.date(‘D’)
<blockquote>D A textual representation of a day, three letters Mon through Sun</blockquote>
Now we know it’ll return Mon … Sun . So how to translate it ?
– Apply your translate to translate file. it would any file you want to use or even with template file.
– Translate Mon … Sun into your own language
– And apply JText for this
We’ll haveJText::_(date('D'));
And last thing with
date(‘M’)
<blockquote>M A short textual representation of a month, three letters Jan through Dec</blockquote>
Yup ! Do something for Jan .. DecVery easy rite ? Just split issue into small part and follow it step by step.
Thank you,
Viet Vu3 users say Thank You to jooservices for this useful post
nsca Friendnsca
- Join date:
- March 2012
- Posts:
- 247
- Downloads:
- 102
- Uploads:
- 51
- Thanks:
- 66
- Thanked:
- 15 times in 3 posts
April 14, 2015 at 6:26 pm #566933Wich file should I translate?
I have to replace text or a file?
You explain the problem but not the solution!
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
April 15, 2015 at 2:03 am #566961Hi there
<blockquote>Wich file should I translate?</blockquote>
You can apply into any language file you want to store and use. It would be template file.
<blockquote>I have to replace text or a file? </blockquote>
It’s already explained above by follow Joomla JText:: API 🙂 .Thank you,
Viet Vunsca Friendnsca
- Join date:
- March 2012
- Posts:
- 247
- Downloads:
- 102
- Uploads:
- 51
- Thanks:
- 66
- Thanked:
- 15 times in 3 posts
April 16, 2015 at 4:59 pm #567270<em>@jooservices 468601 wrote:</em><blockquote>Hi there
You can apply into any language file you want to store and use. It would be template file.
It’s already explained above by follow Joomla JText:: API 🙂 .
Thank you,
Viet Vu</blockquote>Thank you for your answer. But please, could you be more specific? I dont need “any file” I need an exact file, could you please give me an example like
1) Ccreate “example.php” in “Nn/Yy” directory
2) Paste “this code”
3) “translate”Thank you in advance.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
April 19, 2015 at 5:47 am #567483Hi there
# It’s so hard to say what’s exactly file. Please use logic instead.
In basically you can use template language file.Note:// Actually i provided tips as logic concept. For each user case we can implement it as needed. Instead just “copy & paste”. By this way everything become more flexible and easier.
Thank you,
Viet VuApril 19, 2015 at 7:14 am #567489Hi Viet,
thank you for this thread, it’s important.
Just please explain this step:
<blockquote>- And apply JText for this
We’ll have
Code:JText::_(date(‘D’));
</blockquote>
where should I put this code?thank you
nsca Friendnsca
- Join date:
- March 2012
- Posts:
- 247
- Downloads:
- 102
- Uploads:
- 51
- Thanks:
- 66
- Thanked:
- 15 times in 3 posts
April 20, 2015 at 5:38 am #567564Im not paying to learn how to use logic, this template have an error so if you could be more precise will be appreciate. I need specific steps to resolve this.
This is not a minor change, you are asking me to write code from zero with logic. Please another support member could help me?
I renewed 2 times before my licence, but no more. Unfinished and bugged templates + not support… worse combination ever.
nsca Friendnsca
- Join date:
- March 2012
- Posts:
- 247
- Downloads:
- 102
- Uploads:
- 51
- Thanks:
- 66
- Thanked:
- 15 times in 3 posts
April 20, 2015 at 5:38 am #732674Im not paying to learn how to use logic, this template have an error so if you could be more precise will be appreciate. I need specific steps to resolve this.
This is not a minor change, you are asking me to write code from zero with logic. Please another support member could help me?
I renewed 2 times before my licence, but no more. Unfinished and bugged templates + not support… worse combination ever.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
April 20, 2015 at 7:18 am #567576Hi there
Sorry about this . This’s tips / tricks post not tutorials 🙂
That’s why everything explain with root cause reason and logic how to solve .Actually i already mentioned with team about that bug ( yes. confirmed it’s bug ). Team will fix it asap.
Thank you,
Viet Vujooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
April 20, 2015 at 7:18 am #732686Hi there
Sorry about this . This’s tips / tricks post not tutorials 🙂
That’s why everything explain with root cause reason and logic how to solve .Actually i already mentioned with team about that bug ( yes. confirmed it’s bug ). Team will fix it asap.
Thank you,
Viet Vu -
AuthorPosts
This topic contains 10 replies, has 3 voices, and was last updated by jooservices 9 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum