Aid to find untranslated (orphaned) strings

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Aid to find untranslated (orphaned) strings

Post by masterchief » Mon Feb 05, 2007 2:28 am

I've just committed (and should be available in the next nightly) an addition to the debug plugin and the language handler.

If you have the Global Configuration setting "Debug Language" set to on, JLanguage will keep track of orphaned strings (Note: ??this type??, but not !!this type!!).  I've added an option to the Debug Plugin to be able to display these as well (see screen shot).

Hopefully this will speed up the process of compiling language files.  For the third party developer, it should mean that you just write your code wrapping everything in JText methods as appropriate and then last of all turn debugging on, cut-and-paste and, viola!, your language file is more of less ready (yeah, you still need to do a little hand work for some things).  I know it's certainly going to help speed up committing the missing strings to the trunk :)
You do not have the required permissions to view the files attached to this post.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18867
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Aid to find untranslated (orphaned) strings

Post by infograf768 » Mon Feb 05, 2007 6:58 am

Linking this to TTs
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
Atrevidoweb
Joomla! Guru
Joomla! Guru
Posts: 893
Joined: Fri Aug 19, 2005 4:01 am
Location: Buenos Aires Argentina
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by Atrevidoweb » Mon Feb 05, 2007 2:30 pm

Great Feature Thanks!
Atrevidoweb

User avatar
CoolAcid
Joomla! Guru
Joomla! Guru
Posts: 786
Joined: Wed Nov 08, 2006 1:45 am
Location: Ontario, Canada
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by CoolAcid » Mon Feb 12, 2007 1:56 am

Going to move this over the the DEV forum to keep Q&T clean.
Thank you for calling the GOD department. What Now?
- My Blog: http://www.coolacid.net

User avatar
tcp
Joomla! Ace
Joomla! Ace
Posts: 1548
Joined: Wed Sep 21, 2005 9:25 am
Location: Thailand
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by tcp » Wed Feb 14, 2007 1:48 pm

Andrew: Did you look at the code that I posted on the dev list a week or so ago?  I was looking at a way to identify where the strings were found.  Although my technique involved logging, it could be revised to work with the debug plugin.

tcp
Your solution for a single-page checkout on any website.
http://moolah-ecommerce.com

User avatar
nicholai
Joomla! Explorer
Joomla! Explorer
Posts: 293
Joined: Sun Jun 11, 2006 10:29 am
Location: Netherlands
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by nicholai » Thu Feb 15, 2007 8:08 am

- Backend
- Components "Search"
- Preferences

US: TIPSEARCHSTATISTICS=TIPSEARCHSTATISTICS. So it is not lowered case......

Ment or bug?
Founder and Lead developer of JAM (http://joomladev.org)
JAM is the first J!1.5 only component using AJAX!

igevans
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Thu Feb 09, 2006 10:36 am
Location: Wales

Re: Aid to find untranslated (orphaned) strings

Post by igevans » Sat Feb 17, 2007 6:14 pm

I've been playing about with this over the past few days, and thought I'd post some files for comment.

1: A revised language.php
There are only a few small changes to JLanguage:
  • Add a '_paths' property, used instead of static $paths in JLanguage::load
  • Add a '_fallback' property, and use it to load a default INI file if there isn't one in the active language
  • Add a '_used' property, which is equivalent to '_orphans'
  • Extra get and set methods to access these, and minor changes to the '_', 'load' and '_load' methods
All these are highlighted in the attached file, including the original code commented out.  None add any significant script overhead, and I think '_fallback' might be an improvement.

2: A System Plugin which provides extended info on the translations strings and files
  • INI files loaded
  • Duplicate Definitions (ones in more than one of the loaded files)
  • Missing Definitions
  • Definitions in use, with a count of how many times used, and a tooltip shoing the source INI file(s)
The plugin requires the revised JLanguage.  It can be published all the time and the class will only load when language debugging is on.

Hacking the core is clearly not very clever, and I apologise for any offence.  If anyone on the Core Team wants to adopt these changes so that the plugin can work of course I'd be very happy for them to do so.

Ifan
You do not have the required permissions to view the files attached to this post.

User avatar
superjose128
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Thu Jun 29, 2006 10:03 am
Location: Madrid, Spain

Re: Aid to find untranslated (orphaned) strings

Post by superjose128 » Thu Feb 22, 2007 8:15 am

The entire JDate class.  :pop

User avatar
CoolAcid
Joomla! Guru
Joomla! Guru
Posts: 786
Joined: Wed Nov 08, 2006 1:45 am
Location: Ontario, Canada
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by CoolAcid » Thu Feb 22, 2007 2:11 pm

What's wrong with the JDate class exactly?
Thank you for calling the GOD department. What Now?
- My Blog: http://www.coolacid.net

User avatar
superjose128
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Thu Jun 29, 2006 10:03 am
Location: Madrid, Spain

Re: Aid to find untranslated (orphaned) strings

Post by superjose128 » Thu Feb 22, 2007 4:04 pm

It parses the date without taking into consideration the current language:

For example:

Code: Select all

if (preg_match("~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~",$date,$matches))
		{
			$months = Array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
Perhaps I'm wrong...  :-[

Thanks  :-*

User avatar
CoolAcid
Joomla! Guru
Joomla! Guru
Posts: 786
Joined: Wed Nov 08, 2006 1:45 am
Location: Ontario, Canada
Contact:

Re: Aid to find untranslated (orphaned) strings

Post by CoolAcid » Thu Feb 22, 2007 4:31 pm

Interestingly enough I had seen that while working on JDate. Also, I read somewhere while working other issues GNU standards say that all time parsing should be done in the Eng equivalent.

Here is a link: http://www.gnu.org/software/tar/manual/ ... tml#SEC110
In the current implementation, only English is supported for words and abbreviations like `AM', `DST', `EST', `first', `January', `Sunday', `tomorrow', and `year'.
Thank you for calling the GOD department. What Now?
- My Blog: http://www.coolacid.net


Locked

Return to “Joomla! 1.5 Coding”