patchBattle for Wesnoth - Patches: patch #3777, Add a way to translate months,...

 
 
Show feedback again

patch #3777: Add a way to translate months, weekdays and AM/PM

Submitted by:  Andrius Silinskas <thunderstruck>
Submitted on:  Tue 12 Mar 2013 11:01:34 AM UTC  
 
Priority: 5 - NormalStatus: Done
Privacy: PublicAssigned to: Mark de Wever <mordante>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 29 Mar 2013 09:44:38 PM UTC, comment #2:

Different approach was taken to fix/avoid issues mordante noticed:
An strftime function with translatable date info was written to be used as a fallback if the requested locale is missing. The new strftime works like the original strftime except that it is independent from the locales on the machine and uses translatable strings. Also undocumented behaviour (misuse) of the original strftime might not always match the fallback strftime's behaviour.

(file #17603)

Andrius Silinskas <thunderstruck>
Project Member
Wed 13 Mar 2013 08:53:11 PM UTC, comment #1:

Some notes I also left in IRC
- what would happen if in language x Saturday is translated as Sunny?
- strcpy is evil do not use it, especially not when the function signature has a maxsize parameter.
- the std::setlocale on line 342 is not done exception safe regarding restoring it, the return on line 351 also will leave us with a modified locale.
- I'm still not sure whether the approach of this patch is the right way. Also not sure whether we want to add extra strings for translators.

Mark de Wever <mordante>
Project MemberIn charge of this item.
Tue 12 Mar 2013 11:01:34 AM UTC, original submission:

Implemented a function wesnoth_strftime and changed calls to strftime with wesnoth_strftime where appropriate. wesnoth_strftime checks if correct time locale in use and acts accordingly: if correct just use strftime to format date, if not also apply gettext to months, weekdays and AM/PM.

Partially fixes bug https://gna.org/bugs/?20268 (AM/PM still won't be displayed if locale in use is correct, but don't support AM/PM).

Andrius Silinskas <thunderstruck>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mordante (Posted a comment)
  • -unavailable- added by espreon (Updated the item)
  • -unavailable- added by thunderstruck (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Mar 2014 02:16:53 PM UTCthunderstruckStatusNone=>Done
      Open/ClosedOpen=>Closed
    Fri 29 Mar 2013 09:44:38 PM UTCthunderstruckAttached File-=>Added date_translations2.patch, #17603
    Tue 12 Mar 2013 07:30:06 PM UTCespreonAssigned toNone=>mordante
    Tue 12 Mar 2013 11:01:34 AM UTCthunderstruckAttached File-=>Added date_translations.patch, #17423
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup