You are currently working on UAT 

60 PHP files

Hi community,

I've read posts about php files, i've tried to create a new type, then I tested it, simulate a translation, exported the translation but there was still a lot of French text in the final .php. 

Then, i noticed that the text to translate is not always between the same tags. 

How should I proceed to have all the text (without tags and other) imported in SDL? 

I'm quite desperate! 

Thanks a lot for your help,

Sophie 

  • Hi Daniel, thankls for replying. Well, if I copy and paste, it's all written on the same line... i've tried to download file but doesn't work... How Am I supposed to proceed? :-)

    <?php return [ 'header' => [ 'title' => 'Keplerk, acheter ou vendre des Bitcoin ₿ | Bitcoin wallet App gratuite', 'meta' => [ 'title' => 'Keplerk, acheter ou vendre des Bitcoin ₿ | Bitcoin wallet App gratuite', 'description' => "Obtenez du Bitcoin facilement. Le ticket Keplerk disponible auprès de 5200 commerçants. Téléchargez l'application wallet Bitcoin (iOS, Android). Gestion simple et sécurisée de Bitcoins.", 'author' => 'Keplerk blockchainTm', ], 'twitter' => "", 'openGraph' => "" ], 's1' => [ 'img-center' => [ 'alt' => "Image d'une jeune homme avec des lunettes" ], 'top-title' => 'LE COMPTE KEPLERK', 'h1'=>'Le Bitcoin by Keplerk', 'ul' => [ 'Tickets 50€, 100€, 250€', 'Votre Portefeuille Bitcoin offert' ], 'locator' => 'Disponible dans 5200 points de vente', 'center-image' => [ 'alt' => 'Une équipe commerciale joyeuse dans un espace de coworking' ], 'a' => [ 'title' => 'Carte interactive pour trouver des lieux' ] ], 's2' => [ 'title' => 'Le wallet Keplerk', 'uses' => [ [ 'img' => [ 'src' => '/img/pictures/couple-of-young-colleagues-looking-a-phone', 'alt' => "Démonstration de l'application Keplerk" ], 'top-title' => 'Inscription', 'bot-title' => 'Enregistrement facile', 'p' => "Une création de compte rapide et fluide qui vous fera bénéficier d'un wallet crypto* intégré ainsi qu'un panel complet de fonctionalités", 'a' => [ 'title' => 'Découvrir les fonctionnalités offertes par Keplerk', 'href' => 'rt_hiw' ] ], [ 'img' => [ 'src' => '/img/pictures/young-woman-scanning-a-keplerk-ticket', 'alt' => "Achat de bitcoin chez le commercant" ], 'top-title' => 'Achat', 'bot-title' => 'Confiance', 'p' => 'Acheter de la cryptomonnaie auprès de votre commercant vous apporte l’assurance de recevoir vos crypto-actifs en toute sérénité', 'a' => [ 'title' => 'Découvrir comment Keplerk vous garantie la sécuritée ', 'href' => 'rt_security' ] ], [ 'img' => [ 'src' => '/img/pictures/keplerk-application-location-on-map', 'alt' => 'Il y a toujours un point de vente près de chez vous' ], 'top-title' => 'Proximité', 'bot-title' => 'Près de chez vous', 'p' => 'Des milliers de distributeurs vous donnant accès à l\'achat de bitcoin. Trouver rapidement un revendeur grâce à notre outils "store locator*"', 'a' => [ 'title' => 'Découvrir le point de vente le plus près de vous', 'href' => 'rt_store-locator' ] ] ] ], 'section-btc-cash' => [ 'title' => "Cours du Bitcoin", 'market' => 'Prix en temps réel', 'a' => [ 'text' => 'Bitcoin Live', 'title' => 'Voir les transactions BTC en temps rée' ] ], 'section-bg-light' => [ [ 'title' => "Notre vocation est de simplifier l'Achat de Bitcoin", 'img' => [ 'src' => '/img/pictures/men-looking-this-smartphone-orange', 'alt' => 'Un homme regardant son téléphone' ], 'sub-title' => 'Une solution complète', 'p' => 'Keplerk blockchainTm offre une solution complète combinant la disponibilité du bitcoin chez les commercants, une interface de gestion ergonomique et des conditions claires et transparentes.', 'a' => [ 'text' => 'Découvrir', 'href' => 'rt_hiw', 'title' => 'Découvrir la solution complète de Keplerk' ] ] ], 'section-bg-light-bullet' => [ [ 'src' => '/img/pictures/men-looking-this-smartphone-orange_m', 'alt' => 'Un homme regardant son téléphone' ],[ 'src' => '/img/pictures/young-woman-purple_m', 'alt' => "Une jeune femme sur un fond violet" ], [ 'src' => '/img/pictures/two-womans-dancing_m', 'alt' => "Deux femmes qui dansent" ], ], 'section-video' => [ 'title' => 'Le Bitcoin pour tous', 'p' => 'Permettre également aux utilisateurs les moins expérimentés d’acquérir leur cryptomonnaie en toute simplicité.', 'link' => [ 'text' => 'En savoir plus', ], 'img' => [ 'alt' => 'Icone bouton play' ] ], 's6' => [ 'title-1' => 'Reprenez le contrôle', 'p-1' => 'La meilleure alternative aux banques qui limitent leurs clients sur l’affectation de leurs dépenses. Acheter et dépenser du bitcoin en toute liberté. Le paiement en bitcoin vous offre la possibilité de dissocier les données collectées lors de vos achats en ligne et celles recueillies par votre banque.', 'img-1' => [ 'alt' => "Un homme d'affaire hypster se tient dans la rue", ], 'title-2' => 'Transparence totale sur les frais', 'p-2' => "Les frais sont calculés sur le cours du bitcoin de l’un des principaux exchange (Bitfinex). Pas de frais cachés ni de mauvaise surprise. Avec le service Bitcoin Direct®, vous êtes informés sur la quantitée de bitcoin à percevoir au moment de l’achat.", 'img-2' => [ 'alt' => 'Des amies heureux utilisant leur téléphone', ] ], 'section-bg-dark' => [ 'top-title' => 'Un objectif précis', 'title' => 'Optimiser l\'expérience d\'achat de cryptomonnaie', 'p' => 'Keplerk blockchainTm offre des services et des outils permettant aux utilisateurs d\'obtenir et d\'utiliser leurs crypto-actifs dans la transparence, la confiance et la sécurité.', 'a' => [ 'text' => 'En savoir plus', 'title' => 'En savoir plus l\'expérience d\'achat de Keplerk' ], 'phone-1' => [ 'alt' => 'La page d\'accueil de l\'application Keplerk', ], 'phone-2' => [ 'alt' => 'La page pour recevoir du bitcoin avec un QRcode de l\'application Keplerk' ] ], 'section-backgrounds' => [ 'img-1' => [ 'alt' => "Icone d'un telephone" ], 'top-title-1' => "Télécharger l'application", 'top-title-2' => "S'enregistrer", 'p-1' => 'Télécharger sur votre smartphone l’application KeplerK BlockchainTm', 'img-2' => [ 'alt' => "Icone d'un telephone" ], 'p-2' => 'La création de votre compte Keplerk BlockchainTm est rapide et fluide. Une fois la validation réalisée, il vous permettra d’avoir accès à tous les outils Keplerk', 'top-title-3' => 'Acheter du bitcoin', 'img-3' => [ 'alt' => "Icone d'un verrou de sécurité" ], 'p-3' => 'Trouver un point de vente Keplerk BlockchainTm (en utilisant le "store locator" si besoin). Choisir parmi les montants proposés par votre commerçant. Obtenir ses bitcoins sur le wallet de votre choix', ], 'section-new' => [ 'title' => 'Actualités récentes & Blog', 'read-more' => 'En savoir plus', 'more' => "Découvrir plus d'articles" ], 'img-arrow-white' => [ 'alt' => 'Icone de fleche blanche' ], 'section-press' => [ 'top-title-1' => 'Acheter du bitcoin', 'p-1' => "Télécharger sur votre smartphone l'application Keplerk BlockchainTm et bénéficier d'un outil unique, permettant d'acheter et d'utiliser ses bitcoins.", 'top-title-2' => 'près de chez vous', 'p-2' => "La révolution crypto démarre auprès de milliers de commerçants, proposant le service Bitcoin Keplerk®.", 'top-title-3' => 'en règlant comme vous le souhaitez', 'p-3' => "La liberté du mode de paiement permet à celles et ceux qui ont décidé de prendre part à la révolution Bitcoin, d'obtenir simplement leurs crypto-actifs.", 'bitcoin-img' => [ 'alt' => 'Logo du Bitcoin' ] ], 'section-appli' => [ 'top-title' => '#BITCOINPOURTOUS', 'bottom-title' => 'Acheter du bitcoin devrait être aussi simple que d\'acheter un café', 'p' => 'Keplerk BlockchainTm a réussi le pari d’apporter de la sécurité, de la simplicité et de la confiance dans l’expérience d’achat de cryptomonnaie', 'hand-img' => [ 'alt' => 'La page home de l\'application Keplerk dans une main', 'src' => 'keplerk-application-home-hand' ] ], 'blog' => [ 'title' => "Accéder aux articles de blog", 'more' => "Voir plus d'articles" ], 'contact' => [ 'top-title' => 'Contact', 'title' => 'Acheter du bitcoin près de chez vous', 'mail' => [ 'href' => 'mailto:?to=info@keplerk.com&subject=[Keplerk.com%20-%20FR]%20Demande%20Information', 'title' => 'Envoyer un email à Keplerk', 'text' => 'info@keplerk.com', 'text-2' => 'Envoyer un message' ], 'phone' => [ 'href' => 'tel:+33182834260', 'title' => 'Appeler Keplerk au téléphone', 'text' => '+33 1 82 83 42 60' ], 'title-2' => 'Rester Informé', 'lieu-title' => "Rester Informé" ] ];
  • Did your customer give you any hint as to which tags are in the code and which he would like you to translate?

    Daniel

  • Duh, come on, guys...
    It takes just a bit of technical knowledge of the web sources to figure out what should be translated...
    It's a PHP array: www.php.net/.../language.types.array.php

    I didn't study the file much, but this should get you started:

    • you need regex based file type
    • start rule: =>\s('|")
    • end rule: ('|")(,|\s\])

    It's not guaranteed to be correct, it's just a starting point!

    Basically, the localizable strings are those enclosed in apostrophes or quotation marks, preceeded by the "double right arrow followed by space", and followed by "either comma or a space followed by closing square bracket".

    The rest is on you...

    And yes, it's another example of result of lame approach to website creation, where the web developer has apparently NO clue about creation of translation-friendly sources :(

  • That file looks suspiciously like one I was sent earlier today by email and just got around to looking at!  The file is a bit inconsistent, but in general can be handled easily enough with this rule:

    Opening
    ^.*?=>\s*['"]

    Closing
    ['"],?$

    But note that there is a bunch of stuff in here that may need to be translated that doesn't follow the same rules as everything else.  Like this for example:

    Screenshot of Trados Studio showing code with a red arrow pointing to an inconsistency in the 'ul' tag where a 'span' element is not closed properly.

    If it has to be handled you'll need to adapt your rules to suit.

    Paul.

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 7:16 PM (GMT 0) on 28 Feb 2024]
  • Thanks a lot to all of you. I'll analyse this tomorrow and try to fix it. php files are completely new for me! Never heard about them before! 

  • Hi there, 

    I'm progressing but I still meet problems. 

    For the moment, I have this one:

    'title' =>'ICO',
    'p' => [
    "Das Akronym für INITIAL COIN OFFER (Initial Money Offer) ist eine Fundraising-Methode im Bereich der Kryptomik. Ähnlich wie bei einem Börsengang mit einem wesentlichen Unterschied, jedoch ohne Regulierung durch eine zentrale Behörde.",
    'Ce procédé permet principalement le financement de projets liés à la technologie blockchain via une collecte de fonds en cryptomonnaie. La volatilité accrue de ces actifs est liée à l’état embryonnaire des projets, dont le succès potentiel est évalué par la légitimité et la notoriété des membres de l’équipe technique combiné à la qualité du White Paper.'

    The first part is translated, and not the second. I don't understand because there is in the rule 

    beginning    '

    ending     .'

    Screenshot of Trados Studio showing a table with columns labeled 'Modele d'ouverture', 'Modele de fermeture', and 'Multiligne'. The 'Modele d'ouverture' column contains the text '.*>s*>*'. The 'Modele de fermeture' column is empty, and the 'Multiligne' column has the word 'Faux' indicating false..

    Why wasn't it extracted? 

    What's wrong with my definition?

    Thanks for your help,

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 7:16 PM (GMT 0) on 28 Feb 2024]
  • Two things probably:

    1. You have not accounted for the [ opening bracket before the traslatable text

    2. It's probably multiline

    But I can't really check because this is not in the sample file I have.

    I also don't know what the second and third rule are supposed to do?

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • I think i've found why. I have the impression that the system considers [.'] and [.',] as the same and [.',] was restrictive, then [.'] was never extracted. This one is solved. 

    Now, I can't find the right codage for this

    meta name='twitter:description' content='Keplerk vous permet d’obtenir du bitcoin près de chez vous comme vous le souhaitez dans la transparence, la confiance et la sécurité • Votre wallet cryptomonnaie est OFFERT à vie ! • Une application, un service client à votre écoute, découvrez vite Keplerk et son achat simplifié de Bitcoin.'>
    <meta name='twitter:app:name:iphone' content='Keplerk'>
    <meta name='twitter:app:id:iphone' content='1455111585'>
    <meta name='twitter:app:name:ipad' content='Keplerk'>
    <meta name='twitter:app:id:ipad' content=''>
    <meta name='twitter:app:name:googleplay' content='Keplerk'>
    <meta name='twitter:app:id:googleplay' content='com.Effitek.quovadev.keplerk'>
    <meta name='twitter:app:country' content='FR'>",
    'openGraph' => "<meta property='og:type' content='business.business'>
    <meta property='og:title' content='Keplerk - Acheter du bitcoin en cash près de chez vous'>
    <meta property='og:url' content='www.keplerk.com/.../'>
    <meta property='og:image' content='www.keplerk.com/.../Keplerk_home.png'>
    <meta property='business:contact_data:street_address' content='17 Chaussée de la Muette'>
    <meta property='business:contact_data:locality' content='Paris'>
    <meta property='business:contact_data:region' content='île de france'>
    <meta property='business:contact_data:postal_code' content='75016'>
    <meta property='business:contact_data:country_name' content='France'>"

     

    I've tried

    begin   [content=']     end ['>]    but doesn't work

    As these are meta, they probably don't need to be translated. i'll ask the client.