Closed (fixed)
Project:
Web File Manager
Version:
6.x-2.11
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2010 at 13:19 UTC
Updated:
26 Mar 2010 at 03:30 UTC
Hello, everyone!
When I try to upload a file that already exists, WebFM provides appended Action:
1. Replace and rename original copy of %filename%
2. Replace and delete original copy of %filename%
3. Rename new copy of %filename%
4. Cancel
How can I translate these lines? Drupal.t () does not provide this opportunity (in contrast to many other lines), and webfm.js does not contain them, as i see...
Please, help me!
Comments
Comment #1
cgmonroe commentedIn case you didn't know, these are defined by the webfm_version_form function. They should be wrapped in a t() call but aren't.
Option 1 to fix it would be to use a form_alter theme or module call to replace the #options array with the language text.
Option 2 would be to modify the webfm.module to properly use the t function, like this:
$filearg = array( '%filename' => $filename, );
'#options' => array(
t('Replace and rename original copy of %filename, $filearg),
t('Replace and delete original copy of %filename', $filearg),
t('Rename new copy of %filename', $filearg),
t('Cancel'),
);
Then use the normal translation features.
Then submit a patch back....
Comment #2
Izingard commentedThanks, 2nd option is fine :)
I changed following function in "webfm.module" file:
function webfm_version_form($filename) {
$form['select'] = array(
'#prefix' => '
'#suffix' => '
',
'#type' => 'radios',
'#title' => t('Select File Versioning Option'),
'#options' => array(t('Replace and rename original copy of '),t('Replace and delete original copy of '),t('Rename new copy of '),t('Cancel')),
'#required' => TRUE,
);
Thanks for help)
Comment #3
robmilne commentedIn head