1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP site editing help

Discussion in 'Web Design & Development' started by juneaid, Jan 9, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. juneaid

    juneaid Thread Starter

    Joined:
    Jan 9, 2011
    Messages:
    3
    Hello,

    I am a newbie for PHP. I have just started using a ecommerce shopping cart software written with php. However, I need to edit some parts such as language. I will translate it manually. I know that most of the wording have been recalled from .sql files to .php files. What I have to do is finding the words in which file located, and replacing them into my language. The problem is although I am searching all the files of the site via FileLocator for a specific word I required, there are only a few outcomes, mostly inside .sql files as expected. But when I replace the that words and upload the site again to the webserver, nothing is changed.

    Is there any one that can help my problem? What am I doing wrong?

    Thanks in advance.
     
  2. ehymel

    ehymel

    Joined:
    Aug 12, 2007
    Messages:
    696
    The fact that you are metioning .sql files suggests that the text you are looking for may be contained in a database, not in the .sql or .php files themselves. Perhaps you could post a portion of a .sql file that you are wanting to change and we can see if that is the problem.
     
  3. juneaid

    juneaid Thread Starter

    Joined:
    Jan 9, 2011
    Messages:
    3
    Thanks for your response ehymel,

    Here is a part of the .sql file;

    INSERT INTO xcart_languages VALUES ('en','lbl_cart_content','Cart content','Labels');
    INSERT INTO xcart_languages VALUES ('en','lbl_cart_is_empty','Cart is empty','Labels');
    INSERT INTO xcart_languages VALUES ('en','lbl_cart_items','Items','Labels');
    INSERT INTO xcart_languages VALUES ('en','lbl_cart_total','Total','Labels');

    For instance, I would like to translate "Cart is empty", I did and uploaded. However, although there is not any copy of that sentence in any other files, nothing has changed and it was still came up as it is.

    So you mention that the real database is something different than .sql files which are the last updated ones in the server. Is that right?
     
  4. DrP

    DrP

    Joined:
    Jul 23, 2005
    Messages:
    739
    What you've got in your .sql file are a set of instructions for your database. Making changes to that file won't do anything unless those instructions are called to action. Presumably, somewhere in your application there is a method of doing that using PHP. There might be an option to do that within the admin area of the shopping cart but if you can't find that (probably) the easiest way of doing this would be to use phpMyAdmin in your cPanel (assuming you have that), open a query window and paste in the code from your .sql file and run it.

    Back up your database first though!
     
  5. ehymel

    ehymel

    Joined:
    Aug 12, 2007
    Messages:
    696
    Juneaid,

    The thing to understand is that your shopping cart website appears to be a database-driven site. That means that the content of site, meaning the words on the page are pulled from a database. As DrP said, the lines from the .sql file that you posted are instructions to make that database. Since these are INSERT INTO commands, this is probably NOT what you want to modify the database, you'll need a different set of commands to do that.

    Alternatively, use something like phpMyAdmin to actually modify the database, translating the phrases that you need to as you go.

    This is not likely going to be a simple task. You might instead choose a shopping cart that supports multiple languages. You'll have to ask someone else for help with that one, though.

    Good luck!
     
  6. DrP

    DrP

    Joined:
    Jul 23, 2005
    Messages:
    739
    Good point! The commands you need will be UPDATE rather than INSERT INTO. I totally agree with ehymel - it'll be much easier if you instead find a shopping cart which already supports the language you're after.
     
  7. juneaid

    juneaid Thread Starter

    Joined:
    Jan 9, 2011
    Messages:
    3
    I really appreciated for your comments. You are quite right about the command type.

    Inside the admin panel there is a part for languges. I have just learnt that in that section it is possible to export English contents just in a file. It is also possible to translate and upload them.

    So that it seems it is not necessary to be lost inside thousands of files in order to find the correct ones to be able to translate the pages.

    As both of you have mentiones, I understood that these kind of changes are to be done from the admin side instead of from files.

    Thank you so much again.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/973647

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice