-
Notifications
You must be signed in to change notification settings - Fork 17
Added monthly translations #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The summary labels were ignoring translations
Gets translation of month string
Added month literals in english
Added month literals in english
When selecting a project (without versions) with subprojects (with versions), the first $f_target_version is referring to a child project, so version_get_id fails to recover info for current project. I have included a previous check to avoid an "ugly" error. The logic should be reviewed but now is safer ;-)
Changed call to get work_types array
Functions modified to work with localized enums
Changed call to get work_types array
Changed call to get work_types array
Changed call to get work_types array
New functions to support plugin enums management
Changed call to get unavailability_types array translated
Added enum strings to show how should be the name formated
|
Awesome! Gonna have a go at merging this. I'm going to make a few modifications, so won't auto-merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's indeed the correct place. I'd add some comments though, something like:
/**
* This is essentially the plugin version of get_enum_element in core/helper_api.
* Given a plugin enum string and num, return the appropriate string for the
* specified user/project
* @param string $p_enum_name
* @param int $p_val
* @param int|null $p_user user id, defaults to null (all users)
* @param int|null $p_project project id, defaults to null (all projects)
* @return string
*/
|
Ok, so I tried merging this (incorporating the changes I made in the comments) locally. There's one thing that bothers me though: the fact that you need to duplicate the work_types (and unavailability_types) in the translations files, while you can easily modify them or add new ones in the config screen of the plugin. That's very contra-intuitive. You could add a note on the config page warning the user that he has to reflect his changes in the string files, because otherwise it'd go wrong:
But then what's the point of still making this configurable, if you still have to go change those string files manually. In fact, the config values are completely useless, you could as well use the English translation string instead! And I can't really come up with a solution for this... Of course, you could argue that it's the same with changing / adding enums in the Mantis core too: you also have to modify both the constants and the translations. So I'm probably nit-picking... what's your opinion ? |
|
Hi Vincent, It's correct it's contra-intuitive, but I have done following the same So, by default, you could not add the enum strings in the languages files, I think for most people no translation is needed, so only some people will I know it's not the better answer, but do you think it could be a solution? Regards, 2013/7/17 Vincent Sels notifications@github.com
|
|
Agreed, using the default values from the config when no translations are found would be the ideal solution. If you can get that to work without too much of a performance loss, that'd be ideal! In that case, you can indeed leave out the default translations in the strings files. It's probably too complicated to include an explanation of how to change the translations in the config page. It's probably best to include that kind of explanation in a separate 'configuration' section in the README.md - but you can leave that to me :) Regards, Vincent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function used anywhere ? Can't find any references - at least not in this master branch, perhaps you use it in other branches of yours ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vincens,
I'm using it in a peace of code that is not still pushed
Regards,
Daniel Tamajón
2013/7/17 Vincent Sels notifications@github.com
In ProjectManagement/pages/html_api.php:
}}
+function print_plugin_enum_string_selected_value( $p_enum_name, $p_val = 0 ) {
Is this function used anywhere ? Can't find any references - at least not
in this master branch, perhaps you use it in other branches of yours ?—
Reply to this email directly or view it on GitHubhttps://github.com//pull/30/files#r5238366
.
|
Vincent, The current code is accepting not using enums in language files. I mean, if Once an administrator add translations, any change through the config page Regards, 2013/7/17 Vincent Sels notifications@github.com
|
Removed enum strings transaltions
|
Hi Vincent, Could you have a look to the code? Regards, 2013/7/18 Daniel Tamajon dtamajon@litesolutions.es
|
The month in 'time_registration_page' was directly the PHP string. With this little change should be translated according to the language file