Removed repeating localisation #124

Merged
asmeron merged 18 commits from YanTheKaller/ubl-settings-update:master into master 3 months ago

@ -119,8 +119,8 @@ install: check uninstall
msgfmt --verbose --use-fuzzy --output-file "$${PATH_FILE_MO}" - < <(msgcat --use-first --no-wrap $${PKGNAME_PO} ./locale/*_$${LANG}.po); \ msgfmt --verbose --use-fuzzy --output-file "$${PATH_FILE_MO}" - < <(msgcat --use-first --no-wrap $${PKGNAME_PO} ./locale/*_$${LANG}.po); \
done done
@for SIZE in 16 32 48; do \ @for SIZE in 16 32 48; do \
install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \ install -dm755 "${DESTDIR}/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "icons/apps/com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \ rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "icons/apps/com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \
done done
@for FILE_ICON in $(wildcard icons/*/*.svg); do \ @for FILE_ICON in $(wildcard icons/*/*.svg); do \
SUB_NAME=$${FILE_ICON#*/}; SUB_NAME=$${SUB_NAME%/*}; \ SUB_NAME=$${FILE_ICON#*/}; SUB_NAME=$${SUB_NAME%/*}; \

@ -17,6 +17,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: source/ubl-strings.h:3
msgid "https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-update"
msgstr ""
#: source/ubl-strings.h:4 source/ubl-strings.h:55 #: source/ubl-strings.h:4 source/ubl-strings.h:55
msgid "System update" msgid "System update"
msgstr "" msgstr ""

@ -17,6 +17,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: source/ubl-strings.h:3
msgid "https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-update"
msgstr "https://wiki.ublinux.com/ru/software/programs_and_utilities/all/ubl-settings-update"
#: source/ubl-strings.h:4 source/ubl-strings.h:55 #: source/ubl-strings.h:4 source/ubl-strings.h:55
msgid "System update" msgid "System update"
msgstr "Обновление системы" msgstr "Обновление системы"
@ -659,11 +663,11 @@ msgstr "Хранилище:"
#: source/ubl-strings.h:171 #: source/ubl-strings.h:171
msgid "Anonymous user" msgid "Anonymous user"
msgstr "Аноноимный пользователь" msgstr "Анонимный пользователь"
#: source/ubl-strings.h:171 #: source/ubl-strings.h:171
msgid "Anonymous user:" msgid "Anonymous user:"
msgstr "Аноноимный пользователь:" msgstr "Анонимный пользователь:"
#: source/ubl-strings.h:172 #: source/ubl-strings.h:172
msgid "Open user list" msgid "Open user list"

@ -47,7 +47,7 @@ void on_ftp_accept(GtkWidget *, ftp_window *window){
yon_char_return_if_exist(port,""), yon_char_return_if_exist(port,""),
yon_char_return_if_exist(user,""), yon_char_return_if_exist(user,""),
NULL); NULL);
char *parameter_string = yon_char_parsed_to_string(parameters,size,":"); char *parameter_string = yon_char_parsed_to_string_full(parameters,size,":");
char *parameter_name = REPOPUBLIC_FTP(id_string); char *parameter_name = REPOPUBLIC_FTP(id_string);
char *parameter_command = REPOPUBLIC_FTP_command(id_string); char *parameter_command = REPOPUBLIC_FTP_command(id_string);
@ -174,17 +174,17 @@ void on_ftp_remove(GtkWidget *,main_window *widgets){
dialog_confirmation_data *data = yon_confirmation_dialog_data_new(); dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->title = REMOVE_FTP_TITLE_LABEL; data->title = REMOVE_FTP_TITLE_LABEL;
data->action_text = REMOVE_REPO_WARNING_LABEL; data->action_text = REMOVE_REPO_WARNING_LABEL;
if (yon_confirmation_dialog_call(widgets->Window,data)!=GTK_RESPONSE_CANCEL){ if (yon_confirmation_dialog_call(widgets->Window,data)==GTK_RESPONSE_ACCEPT){
char *storage; char *storage;
char *repos; char *repos;
gtk_tree_model_get(model,&iter,1,&storage,2,&repos,-1); gtk_tree_model_get(model,&iter,1,&storage,2,&repos,-1);
char *repos_replaced = yon_char_replace(repos,"\n",","); char *repos_replaced = yon_char_replace(repos,"\n",",");
char *parameter_key = yon_char_unite(storage,":",repos_replaced,NULL); char *parameter_key = yon_char_unite(storage,!yon_char_is_empty(repos_replaced)?":":NULL,repos_replaced,NULL);
char *parameter = REPOPUBLIC_FTP(parameter_key); char *parameter = REPOPUBLIC_FTP(parameter_key);
yon_config_remove_by_key(parameter); yon_config_remove_by_key(parameter);
free(parameter); free(parameter);
free(parameter_key); free(parameter_key);
free(repos_replaced); if (!yon_char_is_empty(repos_replaced)) free(repos_replaced);
yon_interface_update(widgets); yon_interface_update(widgets);
} }
} }

@ -27,21 +27,21 @@ void on_config_custom_save(GtkWidget *, main_window *){
void on_config_local_load(GtkWidget *,main_window *widgets){ void on_config_local_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_LOCAL); yon_load_proceed(YON_CONFIG_LOCAL);
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
main_config.load_mode=YON_CONFIG_LOCAL; main_config.load_mode=YON_CONFIG_LOCAL;
yon_interface_update(widgets); yon_interface_update(widgets);
} }
void on_config_global_load(GtkWidget *,main_window *widgets){ void on_config_global_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_GLOBAL); yon_load_proceed(YON_CONFIG_GLOBAL);
yon_ubl_status_box_render(yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
main_config.load_mode=YON_CONFIG_GLOBAL; main_config.load_mode=YON_CONFIG_GLOBAL;
yon_interface_update(widgets); yon_interface_update(widgets);
} }
void on_config_custom_load(GtkWidget *,main_window *widgets){ void on_config_custom_load(GtkWidget *,main_window *widgets){
yon_load_proceed(YON_CONFIG_CUSTOM); yon_load_proceed(YON_CONFIG_CUSTOM);
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
main_config.load_mode=YON_CONFIG_CUSTOM; main_config.load_mode=YON_CONFIG_CUSTOM;
yon_interface_update(widgets); yon_interface_update(widgets);
} }
@ -60,9 +60,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
yon_config_load_config(type,config_get_command("system"),NULL); yon_config_load_config(type,config_get_command("system"),NULL);
} else if (type==YON_CONFIG_CUSTOM){ } else if (type==YON_CONFIG_CUSTOM){
char *path=""; char *path="";
textdomain(template_ui_LocaleName);
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL); GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
textdomain(LocaleName);
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-services"); gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-services");
gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL); gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL);
GtkFileFilter *filter = gtk_file_filter_new(); GtkFileFilter *filter = gtk_file_filter_new();

@ -11,7 +11,6 @@ void on_save_done(main_window *, config_str output, int size){
free(final_output); free(final_output);
} }
yon_char_parsed_free(output,size); yon_char_parsed_free(output,size);
textdomain(template_ui_LocaleName);
switch (main_config.save_config){ switch (main_config.save_config){
case 0: case 0:
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
@ -23,7 +22,6 @@ void on_save_done(main_window *, config_str output, int size){
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
break; break;
} }
textdomain(LocaleName);
// yon_config_set_ignore(REPOSITORY_parameter); // yon_config_set_ignore(REPOSITORY_parameter);
} }
@ -525,7 +523,13 @@ void yon_interface_update(main_window *widgets){
char *parameter_name = yon_char_divide_search(parameter_string,"=",-1); char *parameter_name = yon_char_divide_search(parameter_string,"=",-1);
char *key = yon_config_parameter_get_key(parameter_name); char *key = yon_config_parameter_get_key(parameter_name);
char *repos = yon_char_replace(key,",","\n"); char *repos = yon_char_replace(key,",","\n");
char *storage = yon_char_divide_search(repos,":",-1); char *storage = NULL;
if (strstr(repos,":")){
storage = yon_char_divide_search(repos,":",-1);
} else {
storage = repos;
repos = NULL;
}
int parsed_size; int parsed_size;
config_str parsed = yon_char_parse(parameter_string,&parsed_size,":"); config_str parsed = yon_char_parse(parameter_string,&parsed_size,":");
@ -1077,8 +1081,9 @@ void on_repo_source_add(GtkWidget *, repo_add_window *window){
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window); g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window);
} }
void on_file_chooser_open(GtkWidget *, GtkEntry *target){ void on_file_chooser_open(GtkWidget *self, GtkEntry *target){
filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN); filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(gtk_widget_get_toplevel(self)),yon_char_get_localised_from_lib(CHOOSE_FILE_LABEL),icon_path,"file_chooser");
if (yon_file_chooser_start(window)){ if (yon_file_chooser_start(window)){
char *file = window->last_any_selection; char *file = window->last_any_selection;
if (!yon_char_is_empty(file)){ if (!yon_char_is_empty(file)){
@ -1094,11 +1099,13 @@ void on_repo_file_chooser_open(GtkWidget *, repo_add_window *window){
if (yon_char_is_empty(source_type)){ if (yon_char_is_empty(source_type)){
GtkFileFilter *filter = gtk_file_filter_new(); GtkFileFilter *filter = gtk_file_filter_new();
fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN); fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
yon_gtk_window_setup(GTK_WINDOW(fchwindow->Window),GTK_WINDOW(window->Window),yon_char_get_localised_from_lib(CHOOSE_FILE_LABEL),icon_path,"file_chooser");
gtk_file_filter_set_name(filter,"*ini"); gtk_file_filter_set_name(filter,"*ini");
gtk_file_filter_add_pattern(filter,"*ini"); gtk_file_filter_add_pattern(filter,"*ini");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fchwindow->MainFileChooser),filter); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fchwindow->MainFileChooser),filter);
} else if (!strcmp(source_type,"file://")){ } else if (!strcmp(source_type,"file://")){
fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
yon_gtk_window_setup(GTK_WINDOW(fchwindow->Window),GTK_WINDOW(window->Window),yon_char_get_localised_from_lib(CHOOSE_FILE_LABEL),icon_path,"file_chooser");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fchwindow->ChooseFolderCheck),1); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fchwindow->ChooseFolderCheck),1);
} else return; } else return;
@ -1490,9 +1497,10 @@ void yon_main_window_complete(main_window *widgets){
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
g_setenv("GDK_BACKEND","x11",1);
textdomain (LocaleName); textdomain (LocaleName);
config_init(); config_init();
yon_ubl_connect_config((_template_config*)&main_config); yon_ubl_connect_config((_template_config*)&main_config);
yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK); yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK);
config_str unfound = NULL; config_str unfound = NULL;
@ -1506,9 +1514,7 @@ int main(int argc, char *argv[]){
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL); char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
yon_window_config_load(path); yon_window_config_load(path);
if (getuid()!=0){ if (getuid()!=0){
textdomain(template_ui_LocaleName);
yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
textdomain(LocaleName);
} }
gtk_main(); gtk_main();
return 0; return 0;

@ -18,7 +18,6 @@
#endif #endif
#include "ubl-strings.h" #include "ubl-strings.h"
#define WIKI_LINK "https://wiki.ublinux.ru/software/programs_and_utilities/all/ubl-settings-update"
#define _(String) gettext(String) #define _(String) gettext(String)
@ -46,8 +45,8 @@
#define sha256_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha256sum | cut -f 1 -d ' '",NULL) #define sha256_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha256sum | cut -f 1 -d ' '",NULL)
#define sha512_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha512sum | cut -f 1 -d ' '",NULL) #define sha512_encrypt_command(target) yon_char_unite("echo -n \"",target,"\" | sha512sum | cut -f 1 -d ' '",NULL)
#define config_get_command(target) yon_char_unite("ubconfig --source ",target," -ea get [update] REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp]",NULL) #define config_get_command(target) yon_char_unite("ubconfig --source ",target," -ea get [update] REPOPUBLIC_NET REPOPUBLIC_WEB REPOSITORY REPOSITORY[*] REPOPUBLIC_WEB REPOPUBLIC_WEB[*] REPOPUBLIC_CACHE REPOPUBLIC_CACHE[*] AUTOUPDATE AUTOUPDATE[mode] AUTOUPDATE[interval] AUTOUPDATE[repos] AUTOUPDATE[timestamp] REPOPUBLIC_FTP[*]",NULL)
#define config_get_default_command "ubconfig --source default get [update] AUTOUPDATE[repos] AUTOUPDATE[interval] AUTOUPDATE[mode] AUTOUPDATE REPOSITORY REPOSITORY[*]" #define config_get_default_command "ubconfig --source default get [update] AUTOUPDATE[repos] AUTOUPDATE[interval] AUTOUPDATE[mode] AUTOUPDATE REPOSITORY REPOSITORY[*] REPOPUBLIC_FTP[*]"
#define config_get_global_only_parameters "" #define config_get_global_only_parameters ""
#define config_get_local_only_parameters "" #define config_get_local_only_parameters ""

@ -1,9 +1,10 @@
#ifndef UBL_SETTINGS_UPDATE_STRINGS #ifndef UBL_SETTINGS_UPDATE_STRINGS
#define UBL_SETTINGS_UPDATE_STRINGS #define UBL_SETTINGS_UPDATE_STRINGS
#define WIKI_LINK _("https://wiki.ublinux.com/en/software/programs_and_utilities/all/ubl-settings-update")
#define TITLE_LABEL _("System update") #define TITLE_LABEL _("System update")
#define TITLE_INFO_LABEL _("System update settings management") #define TITLE_INFO_LABEL _("System update settings management")
#define NOTHING_CHOSEN_LABEL _("Nothing were chosen") // #define NOTHING_CHOSEN_LABEL _("Nothing were chosen")
#define EMPTY_IMPORTANT_LABEL _("Empty important field!") #define EMPTY_IMPORTANT_LABEL _("Empty important field!")
#define ADD_REPO_LABEL _("Add repository") #define ADD_REPO_LABEL _("Add repository")
#define EDIT_REPO_LABEL _("Edit repository") #define EDIT_REPO_LABEL _("Edit repository")
@ -34,6 +35,9 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si
#define PASSWORD_INPUT_LABEL _("Password input") #define PASSWORD_INPUT_LABEL _("Password input")
#define REMOVE_FTP_TITLE_LABEL _("Remove repository") #define REMOVE_FTP_TITLE_LABEL _("Remove repository")
#define STORAGE_PATH_LABEL _("Storage path to publish")
#define PUBLICATION_DIR_PATH_LABEL _("Path to publication directory:")
/* /*
#define _LABEL _("Signature verification will not be performed") #define _LABEL _("Signature verification will not be performed")
#define _LABEL _("Signatures will be verified if present, but unsigned databases and packages will also be accepted") #define _LABEL _("Signatures will be verified if present, but unsigned databases and packages will also be accepted")
@ -50,7 +54,6 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si
#define _LABEL _("Add source") #define _LABEL _("Add source")
#define _LABEL _("Username") #define _LABEL _("Username")
#define _LABEL _("User password") #define _LABEL _("User password")
#define _LABEL _("Storage path to publish")
#define _LABEL _("The full URL of where to find the database, packages, and signatures (if available) for this repository. Multiple can be specified, separated by commas (,)") #define _LABEL _("The full URL of where to find the database, packages, and signatures (if available) for this repository. Multiple can be specified, separated by commas (,)")
#define _LABEL _("Update") #define _LABEL _("Update")
#define _LABEL _("System update") #define _LABEL _("System update")
@ -138,7 +141,6 @@ mirrorlist - mirrors file, make sure server URL is NOT included in this file! Si
#define _LABEL _("Enable installation of packages from this repository during --sync operation") #define _LABEL _("Enable installation of packages from this repository during --sync operation")
#define _LABEL _("Allow this repository to be a valid source of packages when running --sysupgrade") #define _LABEL _("Allow this repository to be a valid source of packages when running --sysupgrade")
#define _LABEL _("Enable publishing of local repository as WEB resource") #define _LABEL _("Enable publishing of local repository as WEB resource")
#define _LABEL _("Path to publication directory:")
#define _LABEL _("Port:") #define _LABEL _("Port:")
#define _LABEL _("Publishing parameters") #define _LABEL _("Publishing parameters")
#define _LABEL _("Enable WEB file browser") #define _LABEL _("Enable WEB file browser")

@ -13,7 +13,7 @@
</object> </object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="upper">65535</property> <property name="upper">65535</property>
<property name="value">8080</property> <property name="value">21</property>
<property name="step-increment">1</property> <property name="step-increment">1</property>
<property name="page-increment">10</property> <property name="page-increment">10</property>
</object> </object>
@ -225,7 +225,7 @@
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="adjustment">adjustment1</property> <property name="adjustment">adjustment1</property>
<property name="value">8080</property> <property name="value">21</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

Loading…
Cancel
Save