Jump to content

Editing the Language File, change wording in store


markscarts

Recommended Posts

This is one of those FAQ's so I'm just posting a comment. Following is from a little tutorial I'm working on. Hopefully this post will help with searches about the subject.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Change Default Titles and other Text in Your Store

- By MarksCarts

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Do you want to make changes to the wording on some of the default

text in your CubeCart™ store? You can generally make those changes

in the Language file, lang.inc.php - here's how to do it.

1. OPEN language/xx/lang.inc.php (replace xx with the two-letter

code that represents the default language for your store: For

example, language/en/lang.inc.php for English).

2. NOTE that this is one of the largest files in your CubeCart™

store file structure. The English lang.inc.php for version 3.0.8

contains a little less than 3,000 lines of code!

3. NOTE the structure of this file:

• The file is divided neatly into two main areas as follows:

/////////////////////////////////////

//// ADMIN LANGUAGE

/////////////////////////////////////

(Admin language arrays, beginning about line 31)

/////////////////////////////////////

//// FRONTEND LANGUAGE

/////////////////////////////////////

(Frontend language, beginning about line 1386)

• Under these main areas, the file is organized into sections

called arrays -

• The beginning of each array looks like this:

Example 1: $lang['admin']['adminusers'] = array(

Example 2: $lang['front']['boxes'] = array(

• The arrays that follow each section are the lines that come between

the parentheses, example: ... array( followed by many lines of code );

• A line belonging to a language array looks like this:

'shop_by_cat' => "Shop by Category",

• To change text appearing in your store, you must change only the words

appearing between double quotes on the right side of the equation. For

example, if you changed the line above to read like this:

'shop_by_cat' => "Choose a Category",

then, the title bar in your category side box would read Choose a Category

instead of Shop by Category.

• You can change most all of the language text appearing in your store

by following this method.

4. SEARCH for the exact text you want to change. The search function in your

text editor is your friend; remember, there are nearly 3,000 lines of text here.

Also, remember that a term or phrase may be listed more than once in this file,

so pay attention to the array section name to ensure that you change the text

in the right place.

5. REPLACE only the text between double quotes on the right side of the

equation, so that it reads as you wish it to.

6. SAVE and UPLOAD the file to your webserver.

END of mod.

-----------------------

Today I had an email from someone about this. Please note that I do not often have time to answer emails on topics that should be covered in the forums, or answered with a search. This member asks,

I have a simple question, How the heck can I change the words "out of stock" to read "pre-order now!" I've used my limited knowledge to comb through some of the templates etc.. but am at a loss of where to edit the text.

Any help would be appreciated!

OPEN language/en/lang.inc.php

FIND at about line 1559:

'out_of_stock' => "OUT OF STOCK",

REPLACE WITH:

'out_of_stock' => "Pre-order Now!",

This will replace OUT OF STOCK in the product list on category page.

Next, FIND at about line 2077:

'out_of_stock' => "OUT OF STOCK",

REPLACE WITH:

'out_of_stock' => "Pre-order Now!",

This will replace OUT OF STOCK on the actual product view page.

Link to comment
Share on other sites

Guest estelle

Mark,

One thing you may want to add to your wonderful looking tutorial, is that a double quote cannot be inserted within the string (since it is used to terminate the string). Therefore the HTML entity " needs to be used instead.

Estelle.

Link to comment
Share on other sites

Mark, as usual, great write up. However I'd suggest the upgrade-proof method instead. By creating a new customized file and merging the arrays, you can change all your text and ensure that it will remain changed even after an upgrade which replaces the stock language file. The majority of the better modders now use this method to add/change language within CubeCart. I think it should at least be mentioned as an option for those savvy enough to use it. :D

:D

Link to comment
Share on other sites

Good Idea, Bill, I need more of that kind of feedback. I just want to help folk get onto the right track, and hopefully save having to answer the same elementary questions so often.

BTW, this tutorial is "25 Small Mods/Tweaks/Settings to Answer FAQ's" - vol. 1 :D

It is another litle tutorial meant to be very elementary and helpful to newbies. I'm open to suggestions on subjects to include :D

Link to comment
Share on other sites

George Bernard Shaw once said that England and America are two countries separated by one language. Aside from using different words for the same thing (pram for baby carriage, lift for elevator, etc.) differences in spelling are all over the place (colour versus color, etc.).

Then there are differences in style and usage. England tends to politeness that can be perceived as affectation; America to a directness that borders on bluntness. Neither negatives are intended, but the truth is, each may see the other's usage in less than best light.

Add to that the fact that, precocious grade-school-aged computer programmers were often creating shopping carts while some of us less intelligent types were studying sentence structure for clarity and learning grammar for precision.

Mark, your tutorial is excellent - and the comments of others here to whom I bow in sincere respect - are excellent - as far as they go. But they do not address the issues of spelling, grammar, punctuation and style as this humble non-programmer sees it. An Americanized language file may be of use to those who want to just replace the default English version (and my apologies to Brooky and Sir Williams whose texts are thus edited. No criticism or offence is intended.)

I am attaching a file here that I call "amer.lang.inc.php". If someone wishes to substitute it for the default, it should be renamed "lang.inc.php" before it will be effective.

USAGE CAUTION: not only have I Americanized spellings, I have liberally changed entire phrases and sentences such as (but not limited to):

1) the "session has been destroyed" and its related messages now refer to logging out. That should put an end to frantic emails from frightened customers.

2) when "login" is used a verb, it is presented in the edited lang file as "log in." It remains "login" as a noun.

3) word order of some awkward constructions has been changed. For example, messages that begin "Below you may edit the list, etc." has been reversed to more readable "The list of names you may edit is below."

4) redundancies have been cleaned out. For example, when a sentence says "is currently" the word "currently" has been removed because "currently" is implicit in "is." To say both is redundant without adding useful information.

5) The USA has "counties" in all states except Louisiana, which for historical reasons calls them "parishes." However, a county is never required for postal or parcel service. The file now uses simply, "state". Also, while we do occasionally use terms such as "town" and "village" (etc.) the universally accepted format for addresses uses only the word "city." Likewise, we call the postal code a "zip." All references in the lang file have been edited to reflect those realities.

6) I've removed all the synthetic emotions indicators such as, "Please" and "Thank you" and "Sorry". Users are dealing with a computer; they know that. To attribute HAL-like responses to a computer ("I'm sorry Dave. I can't do that.") is patently insincere. Even if a user is not conscious of that insincerity, the subliminal remains.

Likewise, I changed the phrase, "if you feel . . ." (referring to possible erroneous messages) to the more accurate "If you believe . . . ". People "believe" (or not) facts; they "feel" emotions.

7) I found a few typos that probably originate in late-hour coding sessions fueled by too much sugar and caffeine. Most are in the category of "you" where "your" is intended and where I found a singular noun with a plural verb - or vice versa.

8) other edits are intended to make the displayed statements easier to understand in plain language. For example, there is a tendency in CC - and I've seen it also in Invision Boards and Dragonfly, etc (all PHP files), to misapply punctuation marks.

I suspect this arises both from the aforementioned individual emphasis on differing activities at a formative age, as well as the programmer's understandable preference in avoiding punctuation marks that may be parsed as code. Thus, there is a common failure in many PHP lang files to use apostrophes to designate plurality and possession.

Also, the period at the end of sentence is often replaced by the less significant comma.

Too often, there is confusion over the genuine difference between, "which" and "that".

Infinitive splitting instances (with full respect for Churchill's outburst about petty nonsense) have been corrected. For example, "That has already been entered . . . " is more easily understood and more correct grammatically as, "That has been entered already . . . " or even better, when possible, "That has been entered . . . ) - the "already" being redundant of "has been".

For those who are confused on those issues, there is a totally pain-free, genuinely funny, little book (by an English author!). Read, "Eats, Shoots and Leaves." I promise you not only will learn everything about grammar and syntax and punctuation you missed back in the sixth or seventh grade, but you also will find yourself laughing out loud. I have used its (note that there is no apostrophe there) principles to edit the CC lang file.

To those who object that this is petty stuff, I say that grammar and syntax in ordinary language are just as imporatnt as they are in computer code. In both cases you break the rules at the risk of being misunderstood or the thing not working at all.

In sum, caveat lector. But the attached will deliver an Americanized lang file.

Hope this helps. amer.lang.inc.php

Link to comment
Share on other sites

Guest estelle

Wow.. fantastic stuff Joe (if that be your real name :w00t:), and definitely a great read!! Probably the longest post in here that I've read from start to finish! :D

Link to comment
Share on other sites

BTW - I used free PHPdesigner to edit the file. It does a great job of color coding various elements so you can see what's what. See www.mpsoftware.org for free download. Great product. I used to use Editplus but this is superior.

tanks for the compliments.

Yes, Joe is the real name. When I am not off in the Caribbean where I have many small hotels as hosting clients or in Australia or Chicago or Washington DC visiting children and grandchildren, I am here in Jersey City, NJ, directly across the river from the World Trade Center and a fabulous view of the Manhattan skyline.

CC is the best. I now have 3 carts almost ready for prime time and another recently started construction.

Link to comment
Share on other sites

Beautiful Joe. Just plain beautiful. :cry:

:D

heh-heh - so far, no one seems to have noticed that in my version of the lang file, I changed the field label, "Title" to "Honorarium." I am disappointed at the lost opportunity to be pedantic (no relation to "pedo" as it is commonly used).

Abbreviations such as Mr, Mrs, Ms, Dr, Prof, and such that appear ahead of a name are often mistakenly called "title." A title is not what comes before a name; it's what comes after. The formality ahead of a name is the "honorarium" (usually abbreviated as "hon.")

An example of "title" alone when someone is signing a document might be:

Sam Jones, Phd

and the complete form of address when writing *to* him would include both his honorarium and his title,

Dr. Sam Jones, Phd.

A US Congressman or Senator (when not being called things that might not pass the bad-word filter) would be addressed in a letter or subpoena or Grand Jury Indictment as:

Honorable Mary Jones, Representative (district)

While I have this opportunity to be boring, let's cover another element that is frequently mis-named.

"Salutation" is also not Mr, Mrs, etc.

A salutation is the pseudo-affectionate greeting such as,

"Dear Mr. I-don't-really-know-you-but-I'm-calling-you-dear."

I'm sure there are those of you who will be less than appreciative of this unsolicited advice. I would remind you that this material *will be* on the final for grade - and the Grammar and Syntax Police have been alerted to be alert.

class dismissed.

Link to comment
Share on other sites

Wow Joe. Either you're an English Professor or a serious nerd. :w00t:

All kidding aside, you be interested in swapping a copy of the CSV import mod to go over and improve the docs for me?

:innocent:

Link to comment
Share on other sites

Wow Joe. Either you're an English Professor or a serious nerd. :w00t:

All kidding aside, you be interested in swapping a copy of the CSV import mod to go over and improve the docs for me?

:innocent:

I'm worse than a professor. I'm a professional freelance writer. See:

www.travelthenet.com and click on "Joe's Bio."

As for editing your docs, either send me the files or PM me with access and I'll be happy to do it. I may yet take you up on the CVS mod offer but so far, I haven't a need.

Meanwhile, as an alternative, if you have an unspoken-for woman who either has a steady job that promises a goverment pension - or if she has clear title to some good real estate - maybe we can work out something. That offer also is subject to confirming that she also has a good pre-paid dental plan.

Link to comment
Share on other sites

  • 10 months later...
Guest Tomppa71

Is it possible to replace text in a language file with an image? I would like to use certain font throughout the shop, but only way seems to be, that I have them as gifs.

Is it possible and how should I edit the language file?

Or can I have images, that are dependent on language selection so, that I could have different omages for different languages?

Link to comment
Share on other sites

Yes, you may use html - so you can call images in the language file. Here's an example:

'sometitle' => "Some Title Text Here",

could be changed to:

'sometitle' => "<img src='images/general/myimgtitle.gif' alt='keywords here'>"

Just Remember:

• Do not use a double-quote mark " in the html, use a single quote instead, as I have done in the example.

Link to comment
Share on other sites

  • 3 weeks later...

I have a couple of questions.

I want to edit the text for the download links email that gets sent out with the links for digital products.

'digi_email_body2' => "%s

DOWNLOAD LINK:

%s/download.php?pid=%s&oid=%s&ak=%s

~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n",

How can I change the text above so that the product name (which I think is %s is the link itself?

It is possible to create an html template so that you could include logos and banners within the download email?

I tried the following:

<a href='%s/download.php?pid=%s&oid=%s&ak=%s'>%s</a>

but it didn't work.

Link to comment
Share on other sites

It wo0uld be possible I think to get html into the email, but I can't tell you how. The email is created in php file, and it is specified there as a text class email, so you can't use html

I have to ask some others to help with this, as I am also in process of getting this to work for a customer.

Link to comment
Share on other sites

Mark,

Thanks for the reply. I guess I might have to do down the route of the Email Template System to customise the look.

However, I would be interested to hear if you find a solution for your customer.

Link to comment
Share on other sites

I have a couple of questions.

I want to edit the text for the download links email that gets sent out with the links for digital products.

'digi_email_body2' => "%s

DOWNLOAD LINK:

%s/download.php?pid=%s&oid=%s&ak=%s

~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n",

How can I change the text above so that the product name (which I think is %s is the link itself?

It is possible to create an html template so that you could include logos and banners within the download email?

I tried the following:

<a href='%s/download.php?pid=%s&oid=%s&ak=%s'>%s</a>

but it didn't work.

Html tags in txt type of email are useless, you have to set html type of email first.

%s in your example is blank until you assign a value for it (select the appropriate product name from inventory and add it as the nex sprintf parameter).

Link to comment
Share on other sites

Html tags in txt type of email are useless, you have to set html type of email first.

%s in your example is blank until you assign a value for it (select the appropriate product name from inventory and add it as the nex sprintf parameter).

Convict,

Thanks for taking time to reply. I can kind of understand what you mean but given my total lack of php, etc I don't know what I need to do.

Thanks for taking time to respond though.

Regards,

Euan

Link to comment
Share on other sites

Html tags in txt type of email are useless, you have to set html type of email first.

%s in your example is blank until you assign a value for it (select the appropriate product name from inventory and add it as the nex sprintf parameter).

Convict,

Thanks for taking time to reply. I can kind of understand what you mean but given my total lack of php, etc I don't know what I need to do.

Thanks for taking time to respond though.

Regards,

Euan

Well I did a separate topic for HTML format of digital goods download emails ;)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...