Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tray
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
tray
Commits
f33b8c68
Commit
f33b8c68
authored
Jul 03, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename and added gettext locales
parent
33032258
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
132 additions
and
8 deletions
+132
-8
CMakeLists.txt
CMakeLists.txt
+3
-3
example_pp.cpp
example/example_pp.cpp
+13
-3
linux.h
include/tray/platform/linux.h
+1
-1
tray.h
include/tray/tray.h
+1
-0
es.po
locales/es.po
+35
-0
ru.po
locales/ru.po
+35
-0
tray.pot
locales/tray.pot
+33
-0
tray.cpp
src/tray.cpp
+11
-1
No files found.
CMakeLists.txt
View file @
f33b8c68
...
...
@@ -30,9 +30,9 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_executable
(
tray_test example/example.c
)
target_link_libraries
(
tray_test PRIVATE tray
)
add_executable
(
traypp_test
example/example_pp.cpp
)
set_target_properties
(
traypp_test
PROPERTIES CXX_STANDARD 17
)
target_link_libraries
(
traypp_test
PRIVATE tray
)
add_executable
(
pw_tray
example/example_pp.cpp
)
set_target_properties
(
pw_tray
PROPERTIES CXX_STANDARD 17
)
target_link_libraries
(
pw_tray
PRIVATE tray
)
add_custom_command
(
TARGET tray_test
...
...
example/example_pp.cpp
View file @
f33b8c68
...
...
@@ -2,13 +2,23 @@
#include <filesystem>
#include <stdlib.h>
#include <libintl.h>
#include <locale.h>
#define _(STRING) gettext(STRING)
int
main
()
{
setlocale
(
LC_ALL
,
""
);
bindtextdomain
(
"tray"
,
getenv
(
"PWD"
));
textdomain
(
"tray"
);
trays
::
Menu
q
;
q
.
text_
=
"WINEFILE"
;
q
.
text_
=
_
(
"WINEFILE"
)
;
trays
::
Menu
w
;
w
.
text_
=
"TASKMGR"
;
w
.
text_
=
_
(
"TASKMGR"
)
;
trays
::
Menu
e
;
e
.
text_
=
"CHANGELOG"
;
e
.
text_
=
_
(
"CHANGELOG"
)
;
// linux: png, svg
std
::
string
icon_name
=
"portproton_tray.svg"
;
...
...
include/tray/platform/linux.h
View file @
f33b8c68
...
...
@@ -23,7 +23,6 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) {
item
=
gtk_menu_item_new_with_label
(
m
->
text
);
gtk_menu_item_set_submenu
(
GTK_MENU_ITEM
(
item
),
GTK_WIDGET
(
_tray_menu
(
m
->
submenu
)));
if
(
m
->
cb
!=
NULL
)
{
g_signal_connect
(
item
,
"activate"
,
G_CALLBACK
(
_tray_menu_cb
),
m
);
}
...
...
@@ -38,6 +37,7 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) {
if
(
gtk_init_check
(
0
,
NULL
)
==
FALSE
)
{
return
-
1
;
}
g_set_application_name
(
"PortProton"
);
indicator
=
app_indicator_new
(
TRAY_APPINDICATOR_ID
,
tray
->
icon
,
APP_INDICATOR_CATEGORY_APPLICATION_STATUS
);
app_indicator_set_status
(
indicator
,
APP_INDICATOR_STATUS_ACTIVE
);
...
...
include/tray/tray.h
View file @
f33b8c68
...
...
@@ -5,6 +5,7 @@
#include <vector>
#include "tray_raw.h"
namespace
trays
{
class
Menu
{
public
:
...
...
locales/es.po
0 → 100644
View file @
f33b8c68
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-03 06:25+0500\n"
"PO-Revision-Date: 2024-07-03 07:14+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n"
#: example/example_pp.cpp:17
msgid "WINEFILE"
msgstr "WINEFILE"
#: example/example_pp.cpp:19
msgid "TASKMGR"
msgstr "GESTOR DE TAREAS"
#: example/example_pp.cpp:21
msgid "CHANGELOG"
msgstr "LISTA DE CAMBIOS"
#: src/tray.cpp:20
msgid "FORCE EXIT"
msgstr "SALIDA FORZADA"
locales/ru.po
0 → 100644
View file @
f33b8c68
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-03 06:25+0500\n"
"PO-Revision-Date: 2024-07-03 06:27+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n"
#: example/example_pp.cpp:17
msgid "WINEFILE"
msgstr "ФАЙЛОВЫЙ МЕНЕДЖЕР"
#: example/example_pp.cpp:19
msgid "TASKMGR"
msgstr "ДИСПЕТЧЕР ЗАДАЧ"
#: example/example_pp.cpp:21
msgid "CHANGELOG"
msgstr "ИЗМЕНЕНИЯ"
#: src/tray.cpp:20
msgid "FORCE EXIT"
msgstr "ПРИНУДИТЕЛЬНЫЙ ВЫХОД"
locales/tray.pot
0 → 100644
View file @
f33b8c68
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-03 06:25+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: example/example_pp.cpp:17
msgid "WINEFILE"
msgstr ""
#: example/example_pp.cpp:19
msgid "TASKMGR"
msgstr ""
#: example/example_pp.cpp:21
msgid "CHANGELOG"
msgstr ""
#: src/tray.cpp:20
msgid "FORCE EXIT"
msgstr ""
src/tray.cpp
View file @
f33b8c68
#include "tray/tray.h"
#include <libintl.h>
#include <locale.h>
#define _(STRING) gettext(STRING)
trays
::
Tray
::
Tray
(
std
::
string
icon_path
,
std
::
vector
<
Menu
>
menus
)
:
icon_
(
icon_path
)
{
for
(
auto
m
:
menus
)
{
add
(
m
);
}
setlocale
(
LC_ALL
,
""
);
bindtextdomain
(
"tray"
,
getenv
(
"PWD"
));
textdomain
(
"tray"
);
Menu
exit
;
exit
.
on_click_
=
[](
Menu
*
)
{
system
(
"bash -c tray_icon_click_exit"
);
tray_exit
();
};
exit
.
text_
=
"FORCE EXIT"
;
exit
.
text_
=
_
(
"FORCE EXIT"
)
;
add
(
exit
);
tray_
.
icon
=
&
icon_path
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment