Browse Source

Implemented conferencePeers filter and added plural enabled translation.

pull/18/head
Simon Eisenmann 11 years ago
parent
commit
e4216593dd
  1. 5
      src/i18n/Makefile
  2. 18
      src/i18n/messages-de.po
  3. 17
      src/i18n/messages-ko.po
  4. 17
      src/i18n/messages-zh-cn.po
  5. 16
      src/i18n/messages.pot
  6. 33
      static/js/filters/displayconference.js
  7. 21
      static/js/filters/displayname.js
  8. 8
      static/js/filters/filters.js
  9. 2
      static/partials/statusmessage.html
  10. 2
      static/translation/messages-de.json
  11. 2
      static/translation/messages-ko.json
  12. 2
      static/translation/messages-zh-cn.json

5
src/i18n/Makefile

@ -18,7 +18,7 @@ build: update
$(PYTHON) helpers/languages.py >$(ROOT)/static/translation/languages.js $(PYTHON) helpers/languages.py >$(ROOT)/static/translation/languages.js
extract: extract:
$(PYBABEL) extract -F babel.cfg -k _n:1,2 -k _ \ $(PYBABEL) extract -F babel.cfg --no-default-keywords -k _n:1,2 -k _ \
--no-location --project=$(PROJECT) --version=$(VERSION) \ --no-location --project=$(PROJECT) --version=$(VERSION) \
--copyright-holder=$(COPYRIGHT) --msgid-bugs-address=$(EMAIL) \ --copyright-holder=$(COPYRIGHT) --msgid-bugs-address=$(EMAIL) \
-o messages.pot \ -o messages.pot \
@ -28,7 +28,8 @@ extract:
$(ROOT)/static/js/ \ $(ROOT)/static/js/ \
$(ROOT)/static/js/controllers \ $(ROOT)/static/js/controllers \
$(ROOT)/static/js/directives \ $(ROOT)/static/js/directives \
$(ROOT)/static/js/services $(ROOT)/static/js/services \
$(ROOT)/static/js/filters
update: update:
for lang in $(LANGUAGES) ; do \ for lang in $(LANGUAGES) ; do \

18
src/i18n/messages-de.po

@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely\n" "Project-Id-Version: Spreed Speak Freely\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-04-02 12:37+0200\n" "POT-Creation-Date: 2014-04-08 21:20+0200\n"
"PO-Revision-Date: 2014-04-02 12:37+0100\n" "PO-Revision-Date: 2014-04-08 21:22+0100\n"
"Last-Translator: Simon Eisenmann <simon@struktur.de>\n" "Last-Translator: Simon Eisenmann <simon@struktur.de>\n"
"Language-Team: struktur AG <opensource@struktur.de>\n" "Language-Team: struktur AG <opensource@struktur.de>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@ -448,3 +448,17 @@ msgstr ""
"Der Zugriffscode konnte nicht überprueft werden. Bitte prüfen Sie Ihre " "Der Zugriffscode konnte nicht überprueft werden. Bitte prüfen Sie Ihre "
"Internetverbindung." "Internetverbindung."
msgid "and %2$s"
msgid_plural "and %1$d others"
msgstr[0] "und %2$s"
msgstr[1] "und %1$d weiteren"
msgid "User"
msgstr "Teilnehmer"
msgid "Someone"
msgstr "Unbekannt"
msgid "Me"
msgstr "Ich"

17
src/i18n/messages-ko.po

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely 1.0\n" "Project-Id-Version: Spreed Speak Freely 1.0\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-04-02 12:37+0200\n" "POT-Creation-Date: 2014-04-08 21:20+0200\n"
"PO-Revision-Date: 2014-03-31 23:28+0100\n" "PO-Revision-Date: 2014-03-31 23:28+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Curt Frisemo <curt.frisemo@spreed.com>\n" "Language-Team: Curt Frisemo <curt.frisemo@spreed.com>\n"
@ -435,3 +435,18 @@ msgid ""
"again." "again."
msgstr "접속코드 확인이 실패 했습니다. 인터넷 연결을 확인하고 다시 시도해 주십시오. " msgstr "접속코드 확인이 실패 했습니다. 인터넷 연결을 확인하고 다시 시도해 주십시오. "
#, fuzzy
msgid "and %2$s"
msgid_plural "and %1$d others"
msgstr[0] ""
msgid "User"
msgstr ""
msgid "Someone"
msgstr ""
#, fuzzy
msgid "Me"
msgstr "이름"

17
src/i18n/messages-zh-cn.po

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely 1.0\n" "Project-Id-Version: Spreed Speak Freely 1.0\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-04-02 12:37+0200\n" "POT-Creation-Date: 2014-04-08 21:20+0200\n"
"PO-Revision-Date: 2014-03-31 23:26+0100\n" "PO-Revision-Date: 2014-03-31 23:26+0100\n"
"Last-Translator: Michael P.\n" "Last-Translator: Michael P.\n"
"Language-Team: Curt Frisemo <curt.frisemo@spreed.com>\n" "Language-Team: Curt Frisemo <curt.frisemo@spreed.com>\n"
@ -435,3 +435,18 @@ msgid ""
"again." "again."
msgstr "接入码认证失败。请检查您的网络连接并重试。" msgstr "接入码认证失败。请检查您的网络连接并重试。"
#, fuzzy
msgid "and %2$s"
msgid_plural "and %1$d others"
msgstr[0] ""
msgid "User"
msgstr ""
msgid "Someone"
msgstr ""
#, fuzzy
msgid "Me"
msgstr "名字"

16
src/i18n/messages.pot

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Spreed Speak Freely 1.0\n" "Project-Id-Version: Spreed Speak Freely 1.0\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n" "Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-04-02 12:37+0200\n" "POT-Creation-Date: 2014-04-08 21:20+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -434,3 +434,17 @@ msgid ""
"again." "again."
msgstr "" msgstr ""
msgid "and %2$s"
msgid_plural "and %1$d others"
msgstr[0] ""
msgstr[1] ""
msgid "User"
msgstr ""
msgid "Someone"
msgstr ""
msgid "Me"
msgstr ""

33
static/js/filters/displayconference.js

@ -0,0 +1,33 @@
/*
* Spreed Speak Freely.
* Copyright (C) 2013-2014 struktur AG
*
* This file is part of Spreed Speak Freely.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define([], function() {
// displayConference
return ["safeDisplayName", "translation", function(safeDisplayName, translation) {
return function(peers) {
if (!peers || peers.length === 0) {
return "";
}
return " " + translation._n("and %2$s", "and %1$d others", peers.length, safeDisplayName(peers[0]));
}
}];
});

21
static/js/filters/displayname.js

@ -21,8 +21,14 @@
define([], function() { define([], function() {
// displayName // displayName
return ["buddyData", "appData", function(buddyData, appData) { return ["buddyData", "appData", "translation", function(buddyData, appData, translation) {
var group_chat_id = ""; var group_chat_id = "";
var someones = {
count: 1
};
var user_text = translation._("User");
var someone_text = translation._("Someone");
var me_text = translation._("Me");
return function(id, me_ok) { return function(id, me_ok) {
if (id === group_chat_id) { if (id === group_chat_id) {
return ""; return "";
@ -32,21 +38,26 @@ define([], function() {
if (scope.displayName) { if (scope.displayName) {
return scope.displayName; return scope.displayName;
} }
return "User " + scope.buddyIndex; return user_text + " " + scope.buddyIndex;
} else { } else {
var data = appData.get(); var data = appData.get();
if (data) { if (data) {
if (id === data.id) { if (id === data.id) {
if (me_ok) { if (me_ok) {
return "Me"; return me_text;
} }
if (data.master.displayName) { if (data.master.displayName) {
return data.master.displayName; return data.master.displayName;
} }
return "Me"; return me_text;
} }
} }
return "Unknown //"+id; var someone = someones[id];
if (!someone) {
someone = someone_text + " " + someones.count++;
someones[id] = someone;
}
return someone;
} }
} }
}]; }];

8
static/js/filters/filters.js

@ -22,12 +22,14 @@ define([
'underscore', 'underscore',
'filters/displayname', 'filters/displayname',
'filters/buddyimagesrc' 'filters/buddyimagesrc',
], function(_, displayName, buddyImageSrc) { 'filters/displayconference'
], function(_, displayName, buddyImageSrc, displayConference) {
var filters = { var filters = {
displayName: displayName, displayName: displayName,
buddyImageSrc: buddyImageSrc buddyImageSrc: buddyImageSrc,
displayConference: displayConference
}; };
var initialize = function (angModule) { var initialize = function (angModule) {

2
static/partials/statusmessage.html

@ -3,7 +3,7 @@
<span ng-switch-when="waiting"><span class="msg">{{_("Online")}} </span><i style="color:rgb(132,184,25)" class="fa fa-bullseye"></i> {{id|displayName}} <img class="userpicture" ng-show="master.buddyPicture" ng-src="{{master.buddyPicture}}" alt="" /></span> <span ng-switch-when="waiting"><span class="msg">{{_("Online")}} </span><i style="color:rgb(132,184,25)" class="fa fa-bullseye"></i> {{id|displayName}} <img class="userpicture" ng-show="master.buddyPicture" ng-src="{{master.buddyPicture}}" alt="" /></span>
<span ng-switch-when="connecting"><span class="msg">{{_("Calling")}} {{dialing|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doAbort()"><i class="fa fa-spinner fa-spin"></i> {{_("Hangup")}}</a></span> <span ng-switch-when="connecting"><span class="msg">{{_("Calling")}} {{dialing|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doAbort()"><i class="fa fa-spinner fa-spin"></i> {{_("Hangup")}}</a></span>
<span ng-switch-when="connected"><span class="msg">{{_("In call with")}} {{peer|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span> <span ng-switch-when="connected"><span class="msg">{{_("In call with")}} {{peer|displayName}}</span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span>
<span ng-switch-when="conference"><span class="msg">{{_("Conference with")}} {{peer|displayName}}<span data-ng-pluralize data-count="conferencePeers.length" data-when="{'0': '', '1': ' and {{conferencePeers[0]|displayName}}', 'other': ' and {} others'}"></span></span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span> <span ng-switch-when="conference"><span class="msg">{{_("Conference with")}} {{peer|displayName}}<span>{{conferencePeers|displayConference}}</span></span> <a class="btn btn-small btn-danger" ng-click="doHangup()"><i class="fa fa-sign-out"></i> {{_("Hangup")}}</a></span>
<span ng-switch-when="closed"><span class="msg">{{_("Your are offline")}}</span> <a class="btn btn-small btn-success" ng-click="doReconnect()"><i class="fa fa-sign-in"></i> {{_("Go online")}}</a></span> <span ng-switch-when="closed"><span class="msg">{{_("Your are offline")}}</span> <a class="btn btn-small btn-success" ng-click="doReconnect()"><i class="fa fa-sign-in"></i> {{_("Go online")}}</a></span>
<span ng-switch-when="reconnecting">{{_("Connection interrupted")}} <i class="text-warning fa fa-spinner fa-spin"></i></span> <span ng-switch-when="reconnecting">{{_("Connection interrupted")}} <i class="text-warning fa fa-spinner fa-spin"></i></span>
<span ng-switch-when="error"><span class="msg">{{_("An error occured")}}</span> <a class="btn btn-small btn-success" ng-click="doReconnect()"><i class="fa fa-refresh"></i> {{_("Retry")}}</a></span> <span ng-switch-when="error"><span class="msg">{{_("An error occured")}}</span> <a class="btn btn-small btn-success" ng-click="doReconnect()"><i class="fa fa-refresh"></i> {{_("Retry")}}</a></span>

2
static/translation/messages-de.json

File diff suppressed because one or more lines are too long

2
static/translation/messages-ko.json

File diff suppressed because one or more lines are too long

2
static/translation/messages-zh-cn.json

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save