Skip to content
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

"Missing Translation" all the time #262

Closed
saschaglo opened this issue Apr 3, 2014 · 12 comments
Closed

"Missing Translation" all the time #262

saschaglo opened this issue Apr 3, 2014 · 12 comments
Labels

Comments

@saschaglo
Copy link

Hi there,

I am using PhpStorm on Version 7.1 (Builder 133.982) and Symfony 2.4.

I have one problem with translations. I configured all correctly (I hope) but as all the other features work as intended I think that everything is correct. The problem is that all translations (irrelevant if in twig template or inside controller) are highlighted with the tooltip "Missing Translation".

The thing that confuses me most: if I use the auto completion for the translations, they show up and I could choose from one of them in the list.

There is also no errors at all in PhpStorm... it just do not show up. Suggestions for service container and so on all work good.

One thing I have to tell about my S2-config: I configured all paths for the project to an external (local) server on which my S2-env is running. Maybe that is the issue?

@Haehnchen
Copy link
Owner

i dont check external path at all, but there can be some issue :)
but in your case pls check plugin version. >=0.10.49 ? there is a offline index fallback.

also "check Help -> Show log in ..."

@saschaglo
Copy link
Author

But it's connect to my computer as a network storage. Doesn't treat windows this one like a "normal" hard drive partition? And I AM using the latest version. I'll try to show you how I set up my environment and configuration via screenshots I attach to this message.

Missing Translation
Translation Catalogue
PhpStorm Settings

@saschaglo
Copy link
Author

Ahhh, i know what's wrong here. The idea.log gave me a hint.

In one of those lines the following log-line is written:

2014-04-03 20:54:10,379 [ 493644]   INFO -                Symfony2-Plugin - update translations: Z:\projects\XXX\httpdocs\app\cache\dev\translations\catalogue.undefined.php

You took the undefined from the parameter locale from the parameters.yml file but i had to change this one to the default value undefined instead of de or en (was another workaround with a language-changer, but i do an export to the de-catalogue with JMSTranslationBunde) and so your plugin tries to find these languages under a wrong filename. Maybe you could find another way to gather the translation strings from the files? Or maybe you add an option to let the user choose the catalogue from which the translation strings are taken?

I know, currently it's just relevant for me, but maybe other users will have the same issue in the future...

@Haehnchen
Copy link
Owner

i only filter for php files and inside them the interface. can u validate your export about that?
moreover translations are now working on index, so this file is only a fallback.

if(fileName.startsWith("catalogue") && fileName.endsWith("php")) {
....
if(phpClass != null && symfony2InterfacesUtil.isInstanceOf(phpClass, "\\Symfony\\Component\\Translation\\MessageCatalogueInterface")) {

https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/master/src/fr/adrienbrault/idea/symfony2plugin/translation/parser/TranslationPsiParser.java#L57

@hansnilsson
Copy link

We're using xliff files for translations, so this bites us too.
Our files are names messages.LOCALE.xliff, like messages.sv_SE.xliff.

@Haehnchen
Copy link
Owner

sry i dont use xliff files in my projects, so this is not on my roadmap. moreover this should be not to hard to implement.
i will move all annotations to inspections, they can be disabled easily.

@saschaglo
Copy link
Author

Okay, I'll give that a try the next days and will inform you about that afterwards.

@artursvonda
Copy link

I'm experiencing the same issue. Any update on this?

@verdet23
Copy link

verdet23 commented Jun 3, 2014

Same issue, with .po files.
Hint for translation work, but still error "Missing Translation".

@Haehnchen
Copy link
Owner

i started a testing symfony2 repo at https://github.com/Haehnchen/idea-php-symfony2-plugin-test
now i can see what is wrong :)

translations

Haehnchen added a commit that referenced this issue Jun 7, 2014
… non project files may not change its content #262
@Haehnchen
Copy link
Owner

@saschaglo
so i tested this in detail. content of non project files do not refresh in psimanager. should be fixed now

@Haehnchen
Copy link
Owner

behavior should now reflect more use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants