ongr-io / TranslationsBundle

Translations GUI for translating Symfony static strings
MIT License
5 stars 13 forks source link

Support short bundle name #64

Closed mvar closed 8 years ago

mvar commented 8 years ago

Currently import command requires "full bundle namespace". It should support short form (e.g., ONGRTranslationsBundle).

Also whole import service should be reviewed. Probably it's overcomplicated. (Tip: see Kernel::locateResource().)

EDIT: it looks like configuration also ask full namespaces.

ndinh215 commented 8 years ago

Here, we could use

$bundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('bundle'));
$path =  $bundle->getPath();
$dir = dir($path);

to get the directory of the bundle basing directly on the bundle name instead of the full namespace.

@mvar @saimaz , how do you think?

ndinh215 commented 8 years ago

And another question: here we should have an option to indicate it is a bundle name or namespace? (in case we support importing all translation files for both bundle name and namespace)

saimaz commented 8 years ago

IMO we dont need to support full namespeces. It's useless. According symfony wide practices everybody uses a short notation which is BundleName. e.g. for Translations it would be ONGRTranslationsBundle. And that's it.

ndinh215 commented 8 years ago

Yup, thanks @saimaz

ndinh215 commented 8 years ago

Closes #64