📜 ⬆️ ⬇️

SonataMediaBundle. Russian version of the translation file xliff

Good day habrovchane. While working on the admin part of one Russian-language resource, it became necessary that the entire admin panel was in Russian. In the SonataAdminBundle itself, there is such a file, and this does not cause difficulties. But as it turned out, another Sonatovsky bandl connected to AdminBundle, namely SonataMediaBundle, does not have such an interface. Actually there was a need to translate it, because it did not find on the network. What came out of it? I ask under the cat.

Actually, the process of assigning the current language in Symfony is located in the file app / config / config.yml; we find the translator: {fallback:% locale%} line there (if commented out, uncomment it). After our path lies in the file app / config / parameters.yml in it we find the line locale: en and change to locale: ru . So, we have prepared Symfony for the Russian language.

Actions to be performed further. If you have installed Sonata (and I assume that it is), then you should have the Application folder in her src folder the Sonata folder and, if you include the SonataMediaBundle, the MediaBundle folder should appear. If so, then go there. (If this does not arise, ask in the comments or write on the soap: sin666m4a1fox@gmail.com). In the src / Application / Sonata / MediaBundle folder we find the Resources folder, and in it the translations folder. Actually in it and create a file SonataMediaBundle.ru.xliff with the following contents:
SonataMediaBundle.ru.xliff
 <? xml version = "1.0"?>
 <xliff version = "1.2" xmlns = "urn: oasis: names: tc: xliff: document: 1.2">
     <file source-language = "en" datatype = "plaintext" original = "file.ext">
         <body>
        	 <trans-unit id = "default">
                 <source> default </ source>
                 <target> Default </ target>
             </ trans-unit>
             <trans-unit id = "sidemenu.link_edit_media">
                 <source> sidemenu.link_edit_media </ source>
                 <target> Edit </ target>
             </ trans-unit>
             <trans-unit id = "sidemenu.link_media_view">
                 <source> sidemenu.link_media_view </ source>
                 <target> View </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_media_create">
                 <source> breadcrumb.link_media_create </ source>
                 <target> Create </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_media_list">
                 <source> breadcrumb.link_media_list </ source>
                 <target> Media </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_media_edit">
                 <source> breadcrumb.link_media_edit </ source>
                 <target> Edit </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_media_view">
                 <source> breadcrumb.link_media_view </ source>
                 <target> View </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_media_delete">
                 <source> breadcrumb.link_media_delete </ source>
                 <target> Delete </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_gallery_create">
                 <source> breadcrumb.link_gallery_create </ source>
                 <target> Create </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_gallery_list">
                 <source> breadcrumb.link_gallery_list </ source>
                 <target> Galleries </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_gallery_edit">
                 <source> breadcrumb.link_gallery_edit </ source>
                 <target> Edit </ target>
             </ trans-unit>
             <trans-unit id = "breadcrumb.link_gallery_delete">
                 <source> breadcrumb.link_gallery_delete </ source>
                 <target> Delete </ target>
             </ trans-unit>
             <trans-unit id = "media">
                 <source> media </ source>
                 <target> Media </ target>
             </ trans-unit>
             <trans-unit id = "gallery">
                 <source> gallery </ source>
                 <target> Gallery </ target>
             </ trans-unit>
             <trans-unit id = "title_select_provider">
                 <source> title_select_provider </ source>
                 <target> Choose media provider </ target>
             </ trans-unit>
             <trans-unit id = "no_provider_available">
                 <source> no_provider_available </ source>
                 <target> Provider not available </ target>
             </ trans-unit>
             <trans-unit id = "title.media_preview">
                 <source> title.media_preview </ source>
                 <target> Preview </ target>
             </ trans-unit>
             <trans-unit id = "title.media_thumbnail">
                 <source> title.media_thumbnail </ source>
                 <target> Thumbnail </ target>
             </ trans-unit>
             <trans-unit id = "title.informations">
                 <source> title.informations </ source>
                 <target> Information </ target>
             </ trans-unit>
             <trans-unit id = "label.size">
                 <source> label.size </ source>
                 <target> Size </ target>
             </ trans-unit>
             <trans-unit id = "label.width">
                 <source> label.width </ source>
                 <target> Width </ target>
             </ trans-unit>
             <trans-unit id = "label.height">
                 <source> label.height </ source>
                 <target> Height </ target>
             </ trans-unit>
             <trans-unit id = "label.content_type">
                 <source> label.content_type </ source>
                 <target> Content Type </ target>
             </ trans-unit>
             <trans-unit id = "label.copyright">
                 <source> label.copyright </ source>
                 <target> License </ target>
             </ trans-unit>
             <trans-unit id = "label.author_name">
                 <source> label.author_name </ source>
                 <target> Author </ target>
             </ trans-unit>
             <trans-unit id = "label.cdn">
                 <source> label.cdn </ source>
                 <target> Content Delivery Network </ target>
             </ trans-unit>
             <trans-unit id = "label.to_be_flushed">
                 <source> label.to_be_flushed </ source>
                 <target> Flushable </ target>
             </ trans-unit>
             <trans-unit id = "label.flushed_at">
                 <source> label.flushed_at </ source>
                 <target> Published: </ target>
             </ trans-unit>
             <trans-unit id = "label.public_url">
                 <source> label.public_url </ source>
                 <target> Public Link </ target>
             </ trans-unit>
             <trans-unit id = "label.name">
                 <source> label.name </ source>
                 <target> Name </ target>
             </ trans-unit>
             <trans-unit id = "label.file">
                 <source> label.file </ source>
                 <target> File </ target>
             </ trans-unit>
             <trans-unit id = "label.author">
                 <source> label.author </ source>
                 <target> Author </ target>
             </ trans-unit>
             <trans-unit id = "label.enabled">
                 <source> label.enabled </ source>
                 <target> Enable </ target>
             </ trans-unit>
             <trans-unit id = "label.cdn_is_flushable">
                 <source> label.cdn_is_flushable </ source>
                 <target> Flush CDN </ target>
             </ trans-unit>
             <trans-unit id = "label.video_reference">
                 <source> label.video_reference </ source>
                 <target> Edit video </ target>
             </ trans-unit>
             <trans-unit id = "label.description">
                 <source> label.description </ source>
                 <target> Description </ target>
             </ trans-unit>
             <trans-unit id = "title.formats">
                 <source> title.formats </ source>
                 <target> Formats </ target>
             </ trans-unit>
             <trans-unit id = "label.select_context">
                 <source> label.select_context </ source>
                 <target> Context: </ target>
             </ trans-unit>
             <trans-unit id = "label.select_provider">
                 <source> label.select_provider </ source>
                 <target> Type: </ target>
             </ trans-unit>
             <trans-unit id = "link.all_providers">
                 <source> link.all_providers </ source>
                 <target> All </ target>
             </ trans-unit>
             <trans-unit id = "sonata.media.provider.dailymotion">
                 <source> sonata.media.provider.dailymotion </ source>
                 <target> DailyMotion </ target>
             </ trans-unit>
             <trans-unit id = "sonata.media.provider.youtube">
                 <source> sonata.media.provider.youtube </ source>
                 <target> YouTube </ target>
             </ trans-unit>
             <trans-unit id = "sonata.media.provider.vimeo">
                 <source> sonata.media.provider.vimeo </ source>
                 <target> Vimeo </ target>
             </ trans-unit>
             <trans-unit id = "sonata.media.provider.image">
                 <source> sonata.media.provider.image </ source>
                 <target> Image </ target>
             </ trans-unit>
             <trans-unit id = "sonata.media.provider.file">
                 <source> sonata.media.provider.file </ source>
                 <target> Files </ target>
             </ trans-unit>
             <trans-unit id = "label.protected_download_url">
                 <source> label.protected_download_url </ source>
                 <target> Protected Link </ target>
             </ trans-unit>
             <trans-unit id = "description.roles_download_strategy">
                 <source> description.roles_download_strategy </ source>
                 <target> Media files can be added by users with roles:% roles%. </ target>
             </ trans-unit>
             <trans-unit id = "label.protected_download_url_notice">
                 <source> label.protected_download_url_notice </ source>
                 <target> Warnings </ target>
             </ trans-unit>
             <trans-unit id = "description.public_download_strategy">
                 <source> description.public_download_strategy </ source>
                 <target> Media files can be added by anyone. </ target>
             </ trans-unit>
             <trans-unit id = "description.forbidden_download_strategy">
                 <source> description.forbidden_download_strategy </ source>
                 <target> Media files cannot be added by anyone. </ target>
             </ trans-unit>
             <trans-unit id = "link.test_protected_url">
                 <source> link.test_protected_url </ source>
                 <target> Download link </ target>
             </ trans-unit>
             <trans-unit id = "label.edit_with_pixlr">
                 <source> label.edit_with_pixlr </ source>
                 <target> Edit files with Pixlr </ target>
             </ trans-unit>
             <trans-unit id = "label.pixlr_warning">
                 <source> label.pixlr_warning </ source>
                 <target>
                     <! [CDATA [
                         <span class = "label important"> Important </ span> are <strong> external service </ strong>.  <br />
                         If you are working on confidentiel materials, please do not use this service.
                     ]]>
                 </ target>
             </ trans-unit>
             <trans-unit id = "label.pixlr_express_editor">
                 <source> label.pixlr_express_editor </ source>
                 <target>
                     <! [CDATA [
                         <strong style = "color: white"> Express Editor </ strong> <br />
                         Simple interface for quick editing
                     ]]>
                 </ target>
             </ trans-unit>
             <trans-unit id = "label.pixlr_advanced_editor">
                 <source> label.pixlr_advanced_editor </ source>
                 <target>
                     <! [CDATA [
                         <strong style = "color: white"> Advanced Editor </ strong> <br />
                         Experimented users only
                     ]]>
                 </ target>
             </ trans-unit>
             <trans-unit id = "form.label_enabled">
                 <source> form.label_enabled </ source>
                 <target> Enable </ target>
             </ trans-unit>
             <trans-unit id = "form.label_media">
                 <source> form.label_media </ source>
                 <target> Average </ target>
             </ trans-unit>
             <trans-unit id = "form.label_position">
                 <source> form.label_position </ source>
                 <target> Position </ target>
             </ trans-unit>
             <trans-unit id = "form.label_context">
                 <source> form.label_context </ source>
                 <target> Context </ target>
             </ trans-unit>
             <trans-unit id = "form.label_name">
                 <source> form.label_name </ source>
                 <target> Name </ target>
             </ trans-unit>
             <trans-unit id = "form.label_default_format">
                 <source> form.label_default_format </ source>
                 <target> Format </ target>
             </ trans-unit>
             <trans-unit id = "form.label_gallery_has_medias">
                 <source> form.label_gallery_has_medias </ source>
                 <target> Media </ target>
             </ trans-unit>
             <trans-unit id = "form.label_author_name">
                 <source> form.label_author_name </ source>
                 <target> Author </ target>
             </ trans-unit>
             <trans-unit id = "form.label_cdn_is_flushable">
                 <source> form.label_cdn_is_flushable </ source>
                 <target> Flush CDN </ target>
             </ trans-unit>
             <trans-unit id = "form.label_description">
                 <source> form.label_description </ source>
                 <target> Description </ target>
             </ trans-unit>
             <trans-unit id = "form.label_copyright">
                 <source> form.label_copyright </ source>
                 <target> License </ target>
             </ trans-unit>
             <trans-unit id = "list.label_enabled">
                 <source> list.label_enabled </ source>
                 <target> Enable </ target>
             </ trans-unit>
             <trans-unit id = "list.label_name">
                 <source> list.label_name </ source>
                 <target> Name </ target>
             </ trans-unit>
             <trans-unit id = "list.label_context">
                 <source> list.label_context </ source>
                 <target> Context </ target>
             </ trans-unit>
             <trans-unit id = "list.label_default_format">
                 <source> list.label_default_format </ source>
                 <target> Format </ target>
             </ trans-unit>
             <trans-unit id = "list.label__action">
                 <source> list.label__action </ source>
                 <target> Action </ target>
             </ trans-unit>
             <trans-unit id = "list.label_custom">
                 <source> list.label_custom </ source>
                 <target> Custom </ target>
             </ trans-unit>
             <trans-unit id = "filter.label_name">
                 <source> filter.label_name </ source>
                 <target> Name </ target>
             </ trans-unit>
             <trans-unit id = "filter.label_provider_reference">
                 <source> filter.label_provider_reference </ source>
                 <target> Supplier Link </ target>
             </ trans-unit>

             <trans-unit id = "filter.label_enabled">
                 <source> filter.label_enabled </ source>
                 <target> Enable </ target>
             </ trans-unit>

             <trans-unit id = "filter.label_context">
                 <source> filter.label_context </ source>
                 <target> Context </ target>
             </ trans-unit>
         </ body>
     </ file>
 </ xliff>



I translated this business myself, and somewhere using google translation, therefore, there may be (and probably there are) errors, but you are free to change the values ​​of the Russian version at your own discretion and according to your requirements.
')
PS If there is something superfluous in the file, then I apologize, perhaps the lines from the project are lit up there. Actually that's all. A simple way to do in SonataMediaBundle your translation of buttons and lines. Good luck to all. Until new meetings.

PSS I did not find how to arrange the file xliff for Habrovsky source resets and makes the reading of the file unreal. Sorry, can someone tell me :)

Source: https://habr.com/ru/post/202140/


All Articles