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

From SF profiler, use storage that match config instead of default one #253

Closed

Conversation

B-Galati
Copy link
Contributor

@B-Galati B-Galati commented Aug 11, 2018

Hello,

I configured the bundle to use 2 configs: one with remote storage, one without remote storage.

Here is the full config:

translation:
    http_client: 'httplug.client.translation'
    locales: '%supported_locales%'
    edit_in_place:
        enabled: false
        config_name: front
    configs:
        admin:
            dirs: ["%kernel.project_dir%/templates/admin", "%kernel.project_dir%/src"]
            output_dir: "%kernel.project_dir%/translations"
            output_format: xlf
            blacklist_domains: ['messages']

        front:
            dirs:
                [
                    '%kernel.project_dir%/templates/front',
                    '%kernel.project_dir%/src',
                ]
            output_dir: '%kernel.project_dir%/translations'
            output_format: xlf
            whitelist_domains: ['messages']
            remote_storage: ['php_translation.adapter.loco']

translation_adapter_loco:
    projects:
        messages:
            api_key: '%env(LOCO_API_KEY)%'

The problem was that I was not able to add keys from Symfony profiler page anymore.

Here is a proposal that uses whitelist_domains and blacklist_domains of the bundle config.

It's currently a draft that looks to work from my tests.

If everybody is ok I'll finish it with proper testing and anything required to get it done so let me know for anything :-)

Cheers

TODO

  • tests
  • doc

@B-Galati
Copy link
Contributor Author

B-Galati commented Sep 5, 2018

@Nyholm @bocharsky-bw Let me know if anything is unclear.

IMHO, it's a really annoying bug for DX 😅

@Nyholm
Copy link
Member

Nyholm commented Sep 5, 2018

Ah. Okey. So since you are trying to edit messages that are not in your default (admin) config.
Hm. If I understand correctly, your solution will automatically pick a config related to the domain.

How could we handle situation where the same domain exists in both configs?

@Nyholm
Copy link
Member

Nyholm commented Sep 5, 2018

Btw. Thank you for the ping. I must have missed this pr

@B-Galati
Copy link
Contributor Author

B-Galati commented Sep 5, 2018

At the moment it only writes in one config but we could add the translation in all configs that support that domain. WDYT?

@Nyholm
Copy link
Member

Nyholm commented Sep 5, 2018

Im not sure that is the desired outcome.

Could we approach this issue differently? Maybe we add a feature on the profiler page that allows you to switch configurations?

@B-Galati
Copy link
Contributor Author

B-Galati commented Sep 5, 2018

It sounds like a better approach 👍

@bocharsky-bw
Copy link
Member

Any volunteers for that alternative approach here?

@B-Galati
Copy link
Contributor Author

B-Galati commented Aug 1, 2019

Closing the PR as I will not continue my work on it, might be a good idea to open an issue to keep track of it.

@bocharsky-bw
Copy link
Member

Good idea, I created #325
Thank you!

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

Successfully merging this pull request may close these issues.

3 participants