Posted by Izingard on March 3, 2010 at 1:19pm
Jump to:
| Project: | Web File Manager |
| Version: | 6.x-2.11 |
| Component: | User interface |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
#1
In 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....
#2
Thanks, 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)
#3
In head
#4
Automatically closed -- issue fixed for 2 weeks with no activity.