Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #166991

    bejam
    Participant

    Hi,

    I’ve a problem on my site. Some sentences like “Proceed to Checkout” are not translated in my language (french).

    The fact is when I open the po file, I can see the translation has been fully completed. Even if I regenerate the mo file and put it online, some sentences still not translated.

    The funny thing is some sentences are translated, some are not.

    So could you tell me what to do to repair the sentences that are not translated ?

    Thanks

    #167017

    bejam
    Participant

    Ok, after searching on the forum, I found a method on that page :

    https://theme.co/x/member/forums/topic/woocommerce-in-german/page/2/#post-162099

    the problem is that the code you provide bring an error :

    Parse error: syntax error, unexpected ‘$strings’ (T_VARIABLE), expecting function (T_FUNCTION) in /homepages/12/d177191422/htdocs/wordpress-lesidaner.com/wp-content/themes/x-child-integrity-dark/functions.php on line 10

    After looking on the web I find a solution : to write “public” just before what is written on line 10 :
    $strings = array();

    So my problem seems to be solved. My question is now :
    Is that okay for the site security to do so ? Because on the web, it was written : you can choose public, private or protected.

    #167333

    Rad
    Moderator

    Hi Bejam,

    Not sure why it would throw an error when it works for other users.

    You don’t need to worry about variables being public. It’s just a different type of variable declaration on OOP programming. In fact, it doesn’t need to be public, private, or protected since you’re not doing subclassing, inheritance, or etc.

    It will not make your data accessible on public viewing. It will only make the variable accessible by other codes within your server, and again , since there is no code needed to access them, you don’t need those definition at all.

    Hope this helps.