Jump to content
TNG Community
Sign in to follow this  

Text Variables for Language Translation

Recommended Posts


In  familychart.php and familygroup, the family header  on my system has been modified (by the Simple_SEO Mod) to appear as below and translates into several languages.

DIETZ, Joseph J. and KRZMARZICK, Agnes K. Family

whereas in Erik Hoppes Maternal_and_Paternal Lines Mod, it appears as:

Family: DIETZ, Joseph J. / KRZMARZICK, Agnes K. 

To be consistent have put family to the end of the header in the Mod's php files.   However,for the 'and',  needed to modify Line 156 in the function getFamilyName in globallib.php from:
    return "$husbname / $wifename";        to:

    return "$husbname and $wifename";  which works fine but needs to be a variable for translation.

The file text.php in language folders has  $text['and']='and';   and in several languages, yet when putting this in the statement:

    return $husbname . " " . $text['and'] . " " . $wifename; 

Nothing is displayed for the 'and' at all.  From a variable standpoint,  what am I missing here?

Thanks for any help; not a significant issue to miss translation of 'and', just curious what is wrong in my handling of variables.  Have used with success in many other mods, but never in globallib.php.  There is a global $text at the beginning of the function.

(EDIT: above modified after further testing)

Share this post

Link to post
Share on other sites

Apparently the issue here is the language variables folder text.php not being read in globallib, but alltext.php is.  Once  I put $text['and'] = "and"; (and other languages ) in alltext.php, all worked fine.  The question remaining is: shouldn't both text.php and alltext.php be read for processing variables?  

(EDIT: also variables are properly read from cust_text.php, but not text.php.  Better place for these variables anyway.)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this