Skip to content

extract locales from vue files #65

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cconard96
Copy link
Contributor

No description provided.

@trasher
Copy link
Contributor

trasher commented Sep 1, 2023

Please fix conflict

Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not seems to work as expected.

For instance, after applying the following patch and run the extrat command, the new string was not added to pot file.

diff --git a/js/src/vue/Debug/Toolbar.vue b/js/src/vue/Debug/Toolbar.vue
index 48acb1c694..d59bb80fda 100644
--- a/js/src/vue/Debug/Toolbar.vue
+++ b/js/src/vue/Debug/Toolbar.vue
@@ -328,6 +328,7 @@
             }
         }).done((data) => {
             ajax_request.profile = data;
+            const a = __('This text should be extracted');
 
             $.each(ajax_request.profile.sql.queries, (i, query) => {
                 ajax_request.profile.sql.queries[i].query = cleanSQLQuery(query.query);

@cedric-anne
Copy link
Member

Also, running the command on current main branch result in warnings:

./js/src/vue/Debug/Widget/HTTPRequests.vue:154: warning: unterminated string

@cconard96
Copy link
Contributor Author

It does not seems to work as expected.

For instance, after applying the following patch and run the extrat command, the new string was not added to pot file.

diff --git a/js/src/vue/Debug/Toolbar.vue b/js/src/vue/Debug/Toolbar.vue
index 48acb1c694..d59bb80fda 100644
--- a/js/src/vue/Debug/Toolbar.vue
+++ b/js/src/vue/Debug/Toolbar.vue
@@ -328,6 +328,7 @@
             }
         }).done((data) => {
             ajax_request.profile = data;
+            const a = __('This text should be extracted');
 
             $.each(ajax_request.profile.sql.queries, (i, query) => {
                 ajax_request.profile.sql.queries[i].query = cleanSQLQuery(query.query);

It seems random when it works. I know for a fact that at least some strings were extracted. All using the same __ function.

Also, running the command on current main branch result in warnings:

Makes absolutely no sense to me. A file with nothing even matching the patterns for localization functions and a line that is completely valid JS same with the other line in the function.

row.css('background-color', '#FFFF7B80');

@cedric-anne
Copy link
Member

I think it may be due to some (not so) recent JS language features that are not handled correctly by xgettext.

We have to understand what can cause such issues, to ensure we will not have issues with translation extracting. For instance, here is the kind of issues that may appears when new language features are introduced: https://savannah.gnu.org/bugs/?func=detailitem&item_id=62158

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.

4 participants