Ephoto: More localization! Translators: Update your translations and add new ones!

v-1.6.0
Stephen Houston 8 years ago
parent d9f7185984
commit 2cdf0d8126
  1. 3
      src/bin/ephoto.c
  2. 7
      src/bin/ephoto.h
  3. 16
      src/bin/ephoto_config.c
  4. 26
      src/bin/ephoto_single_browser.c
  5. 18
      src/bin/ephoto_thumb_browser.c

@ -1,5 +1,3 @@
#include <Elementary.h>
#include "config.h"
#include "ephoto.h"
static void _ephoto_display_usage(void);
@ -19,6 +17,7 @@ elm_main(int argc, char **argv)
#if HAVE_GETTEXT && ENABLE_NLS
elm_app_compile_locale_set(LOCALEDIR);
bindtextdomain(PACKAGE, LOCALEDIR);
bind_textdomain_codeset(PACKAGE, "UTF-8");
textdomain(PACKAGE);
#endif

@ -21,7 +21,14 @@
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#ifdef HAVE_PO
#include <locale.h>
#endif
#ifdef HAVE_GETTEXT
#include "gettext.h"
#endif
typedef struct _Ephoto_Config Ephoto_Config;
typedef struct _Ephoto Ephoto;

@ -106,6 +106,7 @@ _add_slideshow_config(Evas_Object *parent, Ephoto *ephoto)
Evas_Object *box, *scroller, *table, *label, *spinner, *hoversel, *hbox, *ic, *button;
const Eina_List *l;
const char *transition;
char buf[PATH_MAX];
box = elm_box_add(parent);
elm_box_horizontal_set(box, EINA_FALSE);
@ -124,12 +125,15 @@ _add_slideshow_config(Evas_Object *parent, Ephoto *ephoto)
evas_object_show(table);
label = elm_label_add(table);
elm_object_text_set(label, "<b>Slideshow Options:</b>");
snprintf(buf, PATH_MAX, "<b>%s</b>", _("Slideshow Options"));
elm_object_text_set(label, buf);
elm_table_pack(table, label, 0, 0, 2, 1);
evas_object_show(label);
label = elm_label_add(table);
elm_object_text_set(label, "<b>Show Each Slide For: </b>");
memset(buf, 0, PATH_MAX);
snprintf(buf, PATH_MAX, "<b>%s:</b>", _("Show Each Slide For"));
elm_object_text_set(label, buf);
evas_object_size_hint_align_set(label, 1.0, EVAS_HINT_FILL);
elm_table_pack(table, label, 0, 1, 1, 1);
evas_object_show(label);
@ -145,7 +149,9 @@ _add_slideshow_config(Evas_Object *parent, Ephoto *ephoto)
ephoto->config->slide_time = spinner;
label = elm_label_add(table);
elm_object_text_set(label, "<b>Slide Transition:</b>");
memset(buf, 0, PATH_MAX);
snprintf(buf, PATH_MAX, "<b>%s:</b>", _("Slide Transition"));
elm_object_text_set(label, buf);
evas_object_size_hint_align_set(label, 1.0, EVAS_HINT_FILL);
elm_table_pack(table, label, 0, 2, 1, 1);
evas_object_show(label);
@ -332,12 +338,12 @@ ephoto_config_window(Ephoto *ephoto)
slideshow = _add_slideshow_config(pager, ephoto);
sit = elm_naviframe_item_push(pager, NULL, NULL, NULL, slideshow, "overlap");
elm_naviframe_item_title_enabled_set(sit, EINA_FALSE, EINA_FALSE);
elm_toolbar_item_append(toolbar, "media-playback-start", "Slideshow", _show_page, sit);
elm_toolbar_item_append(toolbar, "media-playback-start", _("Slideshow"), _show_page, sit);
about = _add_about_config(pager, ephoto);
ait = elm_naviframe_item_insert_after(pager, sit, NULL, NULL, NULL, about, "overlap");
elm_naviframe_item_title_enabled_set(ait, EINA_FALSE, EINA_FALSE);
elm_toolbar_item_append(toolbar, "help-about", "About", _show_page, ait);
elm_toolbar_item_append(toolbar, "help-about", _("About"), _show_page, ait);
elm_naviframe_item_promote(sit);

@ -515,23 +515,23 @@ _ephoto_get_file_size(const char *path)
size_t size = eina_file_size_get(f);
eina_file_close(f);
double dsize = (double)size;
if (dsize < 1024.0) snprintf(isize, sizeof(isize), "%'.0f bytes", dsize);
if (dsize < 1024.0) snprintf(isize, sizeof(isize), "%'.0f %s", dsize, _("bytes"));
else
{
dsize /= 1024.0;
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.0f KB", dsize);
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.0f %s", dsize, _("KB"));
else
{
dsize /= 1024.0;
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.1f MB", dsize);
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.1f %s", dsize, _("MB"));
else
{
dsize /= 1024.0;
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.1f GB", dsize);
if (dsize < 1024) snprintf(isize, sizeof(isize), "%'.1f %s", dsize, _("GB"));
else
{
dsize /= 1024.0;
snprintf(isize, sizeof(isize), "%'.1f TB", dsize);
snprintf(isize, sizeof(isize), "%'.1f %s", dsize, _("TB"));
}
}
}
@ -613,9 +613,9 @@ _ephoto_single_browser_recalc(Ephoto_Single_Browser *sb)
{
evas_object_image_size_get(elm_image_object_get(v->image), &w, &h);
snprintf(image_info, PATH_MAX,
"<b>Type:</b> %s <b>Resolution:</b> %dx%d <b>File Size: </b>%s",
efreet_mime_type_get(sb->entry->path), w, h,
_ephoto_get_file_size(sb->entry->path));
"<b>%s:</b> %s <b>%s:</b> %dx%d <b>%s:</b> %s",
_("Type"), efreet_mime_type_get(sb->entry->path), _("Resolution"), w, h,
_("File Size"), _ephoto_get_file_size(sb->entry->path));
sb->botbox = evas_object_rectangle_add(evas_object_evas_get(sb->table));
evas_object_color_set(sb->botbox, 0, 0, 0, 0);
evas_object_size_hint_min_set(sb->botbox, 0, sb->ephoto->bottom_bar_size);
@ -639,12 +639,12 @@ _ephoto_single_browser_recalc(Ephoto_Single_Browser *sb)
{
sb->nolabel = elm_label_add(sb->table);
elm_label_line_wrap_set(sb->nolabel, ELM_WRAP_WORD);
elm_object_text_set(sb->nolabel, "This image does not exist or is corrupted");
elm_object_text_set(sb->nolabel, _("This image does not exist or is corrupted!"));
evas_object_size_hint_weight_set(sb->nolabel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sb->nolabel, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(sb->table, sb->nolabel, 0, 1, 4, 1);
evas_object_show(sb->nolabel);
ephoto_title_set(sb->ephoto, "Bad Image");
ephoto_title_set(sb->ephoto, _("Bad Image"));
}
}
@ -1213,9 +1213,9 @@ _apply_crop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
evas_object_del(sb->botbox);
snprintf(image_info, PATH_MAX,
"<b>Type:</b> %s <b>Resolution:</b> %dx%d <b>File Size: </b>%s",
efreet_mime_type_get(tmp_path), nw, nh,
_ephoto_get_file_size(tmp_path));
"<b>%s:</b> %s <b>%s:</b> %dx%d <b>%s:</b> %s",
_("Type"), efreet_mime_type_get(tmp_path), _("Resolution"), nw, nh,
_("File Size"), _ephoto_get_file_size(tmp_path));
sb->botbox = evas_object_rectangle_add(evas_object_evas_get(sb->table));
evas_object_color_set(sb->botbox, 0, 0, 0, 0);
evas_object_size_hint_min_set(sb->botbox, 0, sb->ephoto->bottom_bar_size);

@ -676,6 +676,7 @@ _ephoto_thumb_populate_end(void *data, int type EINA_UNUSED, void *event EINA_UN
{
if (!tb->nolabel)
{
char buf[PATH_MAX];
tb->nolabel = elm_label_add(tb->table);
elm_label_line_wrap_set(tb->nolabel, ELM_WRAP_WORD);
elm_object_text_set(tb->nolabel, _("There are no images in this directory"));
@ -683,7 +684,8 @@ _ephoto_thumb_populate_end(void *data, int type EINA_UNUSED, void *event EINA_UN
evas_object_size_hint_align_set(tb->nolabel, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(tb->table, tb->nolabel, 0, 0, 4, 1);
evas_object_show(tb->nolabel);
elm_object_text_set(tb->infolabel, "<b>Total</b> 0 images <b>Size:</b> 0 bytes");
snprintf(buf, PATH_MAX, "<b>%s:</b> 0 %s <b>%s:</b> 0 %s", _("Total"), _("images"), _("Size"), _("bytes"));
elm_object_text_set(tb->infolabel, buf);
}
}
else
@ -697,29 +699,29 @@ _ephoto_thumb_populate_end(void *data, int type EINA_UNUSED, void *event EINA_UN
char isize[PATH_MAX];
char image_info[PATH_MAX];
if (tb->totsize < 1024.0) snprintf(isize, sizeof(isize), "%'.0f bytes", tb->totsize);
if (tb->totsize < 1024.0) snprintf(isize, sizeof(isize), "%'.0f %s", tb->totsize, _("bytes"));
else
{
tb->totsize /= 1024.0;
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.0f KB", tb->totsize);
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.0f %s", tb->totsize, _("KB"));
else
{
tb->totsize /= 1024.0;
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.1f MB", tb->totsize);
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.1f %s", tb->totsize, _("MB"));
else
{
tb->totsize /= 1024.0;
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.1f GB", tb->totsize);
if (tb->totsize < 1024) snprintf(isize, sizeof(isize), "%'.1f %s", tb->totsize, _("GB"));
else
{
tb->totsize /= 1024.0;
snprintf(isize, sizeof(isize), "%'.1f TB", tb->totsize);
snprintf(isize, sizeof(isize), "%'.1f %s", tb->totsize, _("TB"));
}
}
}
}
snprintf(image_info, PATH_MAX, "<b>Total:</b> %d images <b>Size:</b> %s",
tb->totimages, isize);
snprintf(image_info, PATH_MAX, "<b>%s:</b> %d %s <b>%s:</b> %s",
_("Total"), tb->totimages, _("images"), _("Size"), isize);
elm_object_text_set(tb->infolabel, image_info);
}
return ECORE_CALLBACK_PASS_ON;

Loading…
Cancel
Save