Good Moorning

I amb using the project issue tracking. I can translate the category, define the status, so on, but its for me impossible to translate the Component parameters like "Code, Documentation, Miscellaneous, User Interface", and with Priority parameters too.

I am looking for with localization but it is impossible to find this parameters. How can I add news components types?

Thanks

CommentFileSizeAuthor
#1 245363_pi_comonent_trans_1.patch1020 bytesaclight

Comments

aclight’s picture

Title: How Can I change the parameters "Code, Documentation, Misc.."?? » Default values of component should be translatable
Project: Project » Project issue tracking
Version: 5.x-1.0 » 5.x-2.x-dev
Component: Miscellaneous » Issues
Category: task » bug
Status: Active » Needs review
StatusFileSize
new1020 bytes

First of all, I'm not sure why you put this in the Project queue--it belongs in the Project issue tracking queue. This also isn't really a task; I'd typically call it a support request, but since you're right about the component parameters not being translatable, I'll call it a bug report instead.

I feel like this might be a duplicate, since I know that Hass has reported a lot of issues about strings not being translatable, but I can't find another issue about this.

So, I'm not sure what you're actually asking in your question. If your complaint was that the default values of the Component field are not translatable, the attached patch should fix that.

If your question was about how to add additional components or change the default components (but not by translating them), then that's easy. Components can be changed per project. So, after creating a project, click the edit link to edit the project, then select the Issues link/tab, and then add/change the items in the components text area.

As for priority parameters, I believe that those are translatable already. However, it's not possible to add/remove/change those (other than by using Drupal's localization features) without directly hacking the code in project_issue.module.

dimes’s picture

Thanks aclight

I change project_issue.module. with the new code 245363_pi_comonent_trans_1.patch and When I go to the localize module there are no chain with the word "Miscellaneous". I can´t translate because i dont find it.

I tried too change the variables in patch and put :

$node->components = serialize(array(t('A1'), t('A2'), t('A3'), t('A4')));

But I cant see this parameters when I see project_insert. I see "Code, Documentation, etc) yet

What can be the error?

Thanks

aclight’s picture

Hm...i'm not sure. I didn't actually test using the locale module to see if the strings would show up there, but I'm not sure why they wouldn't. I'll have to check this out on my development machine later today or tomorrow and see if the string show up.

aclight’s picture

Ok, I tested this patch on an otherwise clean installation and it does work. However, there are a few caveats you might not have realized:

1. t('Documentation'), etc. is only called when a project node is created. So if you haven't created a new project node since you applied the patch, then the strings would never have been passed through t() and thus you won't see the strings to be able to translate them.

2. Any translations you make to these 4 default component strings will only take effect for *new* projects created after you translate the strings. Once the project node is created, the possible values for the component field for that project are stored in the database, and are therefore not passed through t() again at any point.

So basically this patch will only let you translate the default values of the component field, and only for project created after you translate the strings.

dimes’s picture

thanks a lot aclight

I can see in my drupal. Thanks.

hunmonk’s picture

Status: Needs review » Fixed

looks good. committed to 5.x-1.x, 5.x-2.x, HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.