소스 검색

Generate pot file from the `converse-no-dependencies` build

This is a workaround for the fact that getttext doesn't support ES2015 template
literals and it also allows us to scan for translateable strings in our HTML
templates.
JC Brand 7 년 전
부모
커밋
3d53943f49
6개의 변경된 파일3270개의 추가작업 그리고 544개의 파일을 삭제
  1. 3 3
      Makefile
  2. 15 1
      dist/converse-no-dependencies.js
  3. 2803 253
      dist/converse.js
  4. 442 280
      locale/converse.pot
  5. 5 5
      src/converse-controlbox.js
  6. 2 2
      src/templates/login_panel.html

+ 3 - 3
Makefile

@@ -61,10 +61,10 @@ serve_bg: dev
 ########################################################################
 ########################################################################
 ## Translation machinery
 ## Translation machinery
 
 
-GETTEXT = xgettext --language="JavaScript" --keyword=__ --keyword=___ --from-code=UTF-8 --output=locale/converse.pot src/*.js --package-name=Converse.js --copyright-holder="Jan-Carel Brand" --package-version=3.2.1 -c
+GETTEXT = xgettext --language="JavaScript" --keyword=__ --keyword=___ --from-code=UTF-8 --output=locale/converse.pot dist/converse-no-dependencies.js --package-name=Converse.js --copyright-holder="Jan-Carel Brand" --package-version=3.2.1 -c
 
 
 .PHONY: pot
 .PHONY: pot
-pot:
+pot: dist/converse-no-dependencies.js
 	$(GETTEXT) 2>&1 > /dev/null; exit $$?;
 	$(GETTEXT) 2>&1 > /dev/null; exit $$?;
 
 
 .PHONY: po
 .PHONY: po
@@ -189,7 +189,7 @@ dist/converse-no-jquery.js: transpile src locale node_modules *.js
 dist/converse-no-jquery.min.js: src locale node_modules *.js transpile
 dist/converse-no-jquery.min.js: src locale node_modules *.js transpile
 	$(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.min.js
 	$(RJS) -o src/build.js include=converse wrap.endFile=end-no-jquery.frag exclude=jquery exclude=jquery.noconflict out=dist/converse-no-jquery.min.js
 dist/converse-no-dependencies.js: transpile src locale node_modules *.js
 dist/converse-no-dependencies.js: transpile src locale node_modules *.js
-	$(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.min.js
+	$(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js
 dist/converse-no-dependencies.min.js: src locale node_modules *.js
 dist/converse-no-dependencies.min.js: src locale node_modules *.js
 	$(RJS) -o src/build-no-dependencies.js out=dist/converse-no-dependencies.min.js
 	$(RJS) -o src/build-no-dependencies.js out=dist/converse-no-dependencies.min.js
 dist/converse-mobile.js: transpile src locale node_modules *.js
 dist/converse-mobile.js: transpile src locale node_modules *.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 15 - 1
dist/converse-no-dependencies.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2803 - 253
dist/converse.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 442 - 280
locale/converse.pot


+ 5 - 5
src/converse-controlbox.js

@@ -26,7 +26,6 @@
             "tpl!search_contact",
             "tpl!search_contact",
             "tpl!status_option",
             "tpl!status_option",
             "tpl!spinner",
             "tpl!spinner",
-            "tpl!login_feedback",
             "converse-chatview",
             "converse-chatview",
             "converse-rosterview"
             "converse-rosterview"
     ], factory);
     ], factory);
@@ -50,7 +49,6 @@
             tpl_search_contact,
             tpl_search_contact,
             tpl_status_option,
             tpl_status_option,
             tpl_spinner,
             tpl_spinner,
-            tpl_login_feedback
         ) {
         ) {
     "use strict";
     "use strict";
 
 
@@ -768,17 +766,19 @@
                 searchContacts (ev) {
                 searchContacts (ev) {
                     ev.preventDefault();
                     ev.preventDefault();
                     $.getJSON(_converse.xhr_user_search_url+ "?q=" + $(ev.target).find('input.username').val(), function (data) {
                     $.getJSON(_converse.xhr_user_search_url+ "?q=" + $(ev.target).find('input.username').val(), function (data) {
+                        const title_subscribe = __('Click to add as a chat contact');
+                        const no_users_text = __('No users found');
                         const $ul= $('.search-xmpp ul');
                         const $ul= $('.search-xmpp ul');
                         $ul.find('li.found-user').remove();
                         $ul.find('li.found-user').remove();
                         $ul.find('li.chat-info').remove();
                         $ul.find('li.chat-info').remove();
                         if (!data.length) {
                         if (!data.length) {
-                            $ul.append(`<li class="chat-info">${__('No users found')}</li>`);
+                            $ul.append(`<li class="chat-info">${no_users_text}</li>`);
                         }
                         }
                         $(data).each(function (idx, obj) {
                         $(data).each(function (idx, obj) {
                             $ul.append(
                             $ul.append(
                                 $('<li class="found-user"></li>')
                                 $('<li class="found-user"></li>')
                                 .append(
                                 .append(
-                                    $(`<a class="subscribe-to-user" href="#" title="${__('Click to add as a chat contact')}"></a>`)
+                                    $(`<a class="subscribe-to-user" href="#" title="${title_subscribe}"></a>`)
                                     .attr('data-recipient', Strophe.getNodeFromJid(obj.id)+"@"+Strophe.getDomainFromJid(obj.id))
                                     .attr('data-recipient', Strophe.getNodeFromJid(obj.id)+"@"+Strophe.getDomainFromJid(obj.id))
                                     .text(obj.fullname)
                                     .text(obj.fullname)
                                 )
                                 )
@@ -919,7 +919,7 @@
             _converse.on('disconnected', disconnect);
             _converse.on('disconnected', disconnect);
 
 
             const afterReconnected = function () {
             const afterReconnected = function () {
-                /* After reconnection makes sure the controlbox's is aware.
+                /* After reconnection makes sure the controlbox is aware.
                  */
                  */
                 const view = _converse.chatboxviews.get('controlbox');
                 const view = _converse.chatboxviews.get('controlbox');
                 if (view.model.get('connected')) {
                 if (view.model.get('connected')) {

+ 2 - 2
src/templates/login_panel.html

@@ -12,7 +12,7 @@
         {[ if (authentication == LOGIN || authentication == EXTERNAL) { ]}
         {[ if (authentication == LOGIN || authentication == EXTERNAL) { ]}
             <label>{{{__("Jabber ID:")}}}</label>
             <label>{{{__("Jabber ID:")}}}</label>
             <p class="form-help fade-in error {[ if (!_.includes(errors, 'invalid_jid')) { ]} hidden {[ } ]}">
             <p class="form-help fade-in error {[ if (!_.includes(errors, 'invalid_jid')) { ]} hidden {[ } ]}">
-                {{{_('Please enter a valid XMPP address')}}}
+                {{{__('Please enter a valid XMPP address')}}}
             </p>
             </p>
             <input autofocus
             <input autofocus
                    type="text"
                    type="text"
@@ -22,7 +22,7 @@
             {[ if (authentication !== EXTERNAL) { ]}
             {[ if (authentication !== EXTERNAL) { ]}
                 <label>{{{__("Password:")}}}</label>
                 <label>{{{__("Password:")}}}</label>
                 <p class="form-help fade-in error {[ if (!_.includes(errors, 'password_required')) { ]} hidden {[ } ]}">
                 <p class="form-help fade-in error {[ if (!_.includes(errors, 'password_required')) { ]} hidden {[ } ]}">
-                    {{{_('Please enter your password')}}}
+                    {{{__('Please enter your password')}}}
                 </p>
                 </p>
                 <input type="password"
                 <input type="password"
                        name="password"
                        name="password"

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.