To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #446 (accepted defect)

Opened 20 months ago

Last modified 13 months ago

Make blog and event plugins translatable

Reported by: oestrogen Owned by: tboutell
Priority: major Milestone: 1.5.2
Component: apostrophePlugin Version: 1.4
Keywords: i18n Cc: decano@…
Symfony version: 1.4

Description

Please make it possible to translate the phrases used in the blog and event plugins.

Attachments

changes-i18n.diff Download (11.8 KB) - added by perseo 13 months ago.
Some changes to correct missing a_() function.

Change History

Changed 17 months ago by tboutell

  • owner changed from boutell to tboutell

Changed 13 months ago by geoffd

  • milestone changed from 1.4.2 to 1.5.1

We have made some progress on this in Apostrophe 1.5. Is this working for you now?

Changed 13 months ago by perseo

  • cc decano@… added

I'm using this plugins too and event plugin is not fully translated. For example 'Today', month names or 'You are viewing all events or year events, etc'.

I can help with this if you want because I'm translating for a personal project.

Changed 13 months ago by tboutell

Are you saying the phrases are missing from our English XLIFF file in 1.5? Or just that they are not present in an existing translation?

Changed 13 months ago by perseo

I'm using the last svn sandbox, and the are some phrases not present in the english file and others than don't have the a_() function.

For example in _calendar.php template must be:
a_($calendarmonth?) and not $calendarmonth?
or
</span><?php a_('Today'); ?></a> and not </span>Today</a>

And some sentences are not in apps/frontend/i18n/apostrophe.en.xml
January, February, etc
Add to Google Calendar, ...
event, events...

Changed 13 months ago by tboutell

  • status changed from new to accepted

Thank you for flagging these. We will look into it - of course I'd also gladly accept patches. (We haven't heard from you in a while welcome back!)

Changed 13 months ago by perseo

I'm traslating the phrases direct on the spanish XLIFF file. There are another way to do it? Something like i18:extract command in symfony?

I will send here a patch as soon as I finish to translate every module.

And, this is my first contribution. I'm a new user. Thanks anyway. :-)

Changed 13 months ago by tboutell

My mistake, the original opener of the ticket was another person (:

Anything that is in an a_() should be in the 1.5 branch's apps/frontend/i18n/en.xml file due to automatic extraction. Anything tht isn't in an a_() isn't going to translate yet no matter what (: So patching those or helping us track them down is the best way to help with missing phrases.

Changed 13 months ago by perseo

I about to finish and sent the path, but before that... two more questions:

1)
I found another phrases that are "translated" with () and not with a_()
It's a error, isn't it?

2)
In the _calendar.php template at aEvent module, the week always start in Sunday.
I think that it must detect if DATE_CALC_BEGIN_WEEKDAY constant value is 0 or 1.
I did a little change to support this.

Changed 13 months ago by perseo

Sorry, I must preview my comment before send it.

I want to say some phrases are using _ _() instead of a_() function.

Changed 13 months ago by tboutell

1) ('foo', args, 'apostrophe') is OK. Wordy, but OK. Anything else in the third argument would be cause for concern

2) I'll have to review your changes for this one and understand them better.

Thanks!

Changed 13 months ago by perseo

1) Then:

./aBlogAdmin/templates/_list_bar.php:
<h2 class="a-admin-title you-are-here">
  <?php echo __('Blog Post Admin', array(), 'messages') ?>
</h2>

2) Actually in apostropheBlogPlugin/modules/aEvent/templates/_calendar.php:

                <th class="day sunday">Su</th>
                <th class="day monday">M</th>
                <th class="day tuesday">T</th>
                <th class="day wedsnesday">W</th>
                <th class="day thursday">Th</th>
                <th class="day friday">F</th>
                <th class="day saturday">S</th> 

It would be better:

<?php if (DATE_CALC_BEGIN_WEEKDAY==0): ?>
		<th class="day sunday"><?php echo a_("Su"); ?></th>
<?php endif; ?>
		<th class="day monday"><?php echo a_("M"); ?></th>
		<th class="day tuesday"><?php echo a_("T"); ?></th>
		<th class="day wedsnesday"><?php echo a_("W"); ?></th>
		<th class="day thursday"><?php echo a_("Th"); ?></th>
		<th class="day friday"><?php echo a_("F"); ?></th>
		<th class="day saturday"><?php echo a_("S"); ?></th>																								
<?php if (DATE_CALC_BEGIN_WEEKDAY!=0): ?>
		<th class="day sunday"><?php echo a_("Su"); ?></th>
<?php endif; ?>

For two reasons:
1) In other countries, like Spain, it's more usual to start the week in Monday.
2) It's translatable.

Changed 13 months ago by tboutell

I think this makes sense feel free to include it in your patch

Changed 13 months ago by tboutell

(But does anybody start their week on yet another day? Perhaps the loop should allow for a dynamic starting point rather than having a hack to support Sunday or Monday)

Changed 13 months ago by perseo

Some changes to correct missing a_() function.

Changed 13 months ago by perseo

No way. DATE_CALC_BEGIN_WEEKDAY only works with 0 or 1 values. Tested. Other value distinct 0 or 1 is taked as 0. So the code must be:

<?php if (DATE_CALC_BEGIN_WEEKDAY!=1): ?>
		<th class="day sunday"><?php echo a_("Su"); ?></th>
<?php endif; ?>
		<th class="day monday"><?php echo a_("M"); ?></th>
		<th class="day tuesday"><?php echo a_("T"); ?></th>
		<th class="day wedsnesday"><?php echo a_("W"); ?></th>
		<th class="day thursday"><?php echo a_("Th"); ?></th>
		<th class="day friday"><?php echo a_("F"); ?></th>
		<th class="day saturday"><?php echo a_("S"); ?></th>
<?php if (DATE_CALC_BEGIN_WEEKDAY==1): ?>
		<th class="day sunday"><?php echo a_("Su"); ?></th>
<?php endif; ?>
Note: See TracTickets for help on using tickets.