Skip to Content Skip to Menu

File Field and multilanguage

  • Ntelos
  • Ntelos
  • OFFLINE
  • Posts: 95
  • Thanks: 4
  • Karma: 0
11 years 5 months ago #225632 by Ntelos
File Field and multilanguage was created by Ntelos
Hello there,

I am trying to understand how i could use file field type in a multilanguage site. I have found that all the translation must be done in cb.filefield.php file.

One thought of mine was to copy the plugin and change it into a new custom plugin with the language as only difference. I tried to change the name files for example:
cb.filefield.php -> cb.filefieldgreek.php
cb.filefield.xml -> cb.filefieldgreek.php
images -> images
index.html ->index.html
jquery.cbfield.css -> jquery.cbfieldgreek.css
jquery.cbfield.js -> jquery.cbfieldgreek.js
jquery.cbfield.min.js -> jquery.cbfieldgreek.min.js

Then i noticed that i have to change the xml and php files contents. As for the php file, i tried to change all the variables that contain the word file with filegreek.
When i am uploading the new plugin it successfully installs, i can create a new filegreek field but when i do this, then i don't see the registration page and its this plugin because when i disable it, then it works fine.
Do you know if i could keep some variables and change only a few ones, or it goes to a custom solution?

Thank you in advance

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
11 years 5 months ago - 11 years 5 months ago #225644 by krileon
Replied by krileon on topic File Field and multilanguage
You don't need to edit the plugin. It uses CBTxt usage. So you'll need to take its CBTxt strings and add them to your cbteamplugins language file of your language plugin then translated as needed. Please see the below list of language strings.
Code:
'Has a file' => 'Has a file', 'Has no file' => 'Has no file', 'Please select a file before uploading' => 'Please select a file before uploading', 'Please upload only %s' => 'Please upload only %s', 'The file size exceeds the maximum of %s KB' => 'The file size exceeds the maximum of %s KB', 'The file is too small, the minimum is %s KB' => 'The file is too small, the minimum is %s KB', 'Click or right-click filename to download' => 'Click or right-click filename to download', 'No file' => 'No file', 'No change of file' => 'No change of file', 'Upload new file' => 'Upload new file', 'Upload file' => 'Upload file', 'Remove file' => 'Remove file', 'Select file' => 'Select file', 'Your file must be of [ext] type and should exceed [min] KB, but not [max] KB' => 'Your file must be of [ext] type and should exceed [min] KB, but not [max] KB', 'Terms and Conditions' => 'Terms and Conditions', 'By uploading, you certify that you have the right to distribute this file and that it does not violate the [toc].' => 'By uploading, you certify that you have the right to distribute this file and that it does not violate the [toc].', 'By uploading, you certify that you have the right to distribute this file.' => 'By uploading, you certify that you have the right to distribute this file.',


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 11 years 5 months ago by krileon.
The following user(s) said Thank You: Ntelos

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum