8000 Translate blade files · Issue #2963 · roots/sage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Translate blade files #2963
Closed
Closed
@eduardoarandah

Description

@eduardoarandah

Terms

Summary

I wish there a way of translating blade files easily

Motivation

Why are we doing this?

blade files are central for the theme

What use cases does it support?

translation

What is the expected outcome?

pot files for translation

Potential conflicts / foreseeable issues

may need wp-cli fixing

Additional Context

In order to translate a theme there's the wp-cli command

wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include="app,resources"

however, this doesn't work on blade files as wp-cli doesn't support them:

wp-cli/i18n-command#147

one workaround I tried is compiling to php and then referencing php cache

wp acorn view:cache && wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include="app,../../cache/acorn/framework/views"

however, this doesn't work either, (because such folder is outside I guess)

So, there's this workaround: compiling, copying to current folder and translating

wp acorn view:cache
cp -r ../../cache/acorn/framework/views ./viewscache
wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include="app,viewscache"
rm -rf viewscache

if being used in package.json with yarn translate:pot

  "scripts": {
    ...
    "translate:pot": "wp acorn view:cache && cp -r ../../cache/acorn/framework/views ./viewscache && wp i18n make-pot . ./resources/lang/sage.pot --ignore-domain --include='app,viewscache' && rm -rf viewscache"
  },

It works, but is so ugly.

Is there a recommended approach for translation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0