Zen Cart Logo
Forums / General Questions / List constants from a specific language file?

List constants from a specific language file?

Views: 2,982

Results 1 to 4 of 4
6 Jul 2011, 10:06 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,873
Plugin Contributions:
7

List constants from a specific language file?

In the interests of providing a list of the language constants in each file to a translator for proof-reading and to get a word-count, my question is... how?

I have found how to list all constants:

$const = get_defined_constants();

echo "<pre>";
print_r($const);but how can I extract/list/print the phrases contained in one particular file only?

8 Jul 2011, 10:54 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,873
Plugin Contributions:
7

Re: List constants from a specific language file?

Either this is is such a menial task that any fool should know how to do it or its too hard for the experts here?

I am stuck with this.

I just need to see a list of the phrases on the screen to be able to paste them into Word.

Many phrases have html formatting in them so pasting into Excel and stripping the phrases by the delimiters does not work:
http://www.translatorscafe.com/cafe/article113.htm#lng

By the way, I am updating and paying someone to correct the Portuguese language pack, so some community help would be appreciated.

8 Jul 2011, 11:04 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: List constants from a specific language file?

  1. grab the value of get_defined_constants()
  2. then load the page of defines
  3. then grab the new value of get_defined_constants()
  4. then get an array_diff of the two values
8 Jul 2011, 7:15 PM
#4
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,873
Plugin Contributions:
7

Re: List constants from a specific language file?

Many thanks.
Done!