forked from enlightenment/efl
edje_cc: change .mo file write location to be relative to the .edj file
previously this would attempt to write the .mo file to the same directory that the .po file was found in, which is invalid in cases such as distcheck where the source directory is not writable @fix Differential Revision: https://phab.enlightenment.org/D6636
This commit is contained in:
parent
1cff96fb40
commit
12f92b4bfb
|
@ -1721,12 +1721,17 @@ data_thread_mo(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
void *m = NULL;
|
void *m = NULL;
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
|
|
||||||
// Search the mo file in all the -md ( mo directory )
|
if (mw->mo_path)
|
||||||
EINA_LIST_FOREACH(mo_dirs, ll, dir_path)
|
f = eina_file_open(mw->mo_path, 0);
|
||||||
|
if (!f)
|
||||||
{
|
{
|
||||||
snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src);
|
// Search the mo file in all the -md ( mo directory )
|
||||||
f = eina_file_open(mo_path, 0);
|
EINA_LIST_FOREACH(mo_dirs, ll, dir_path)
|
||||||
if (f) break;
|
{
|
||||||
|
snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src);
|
||||||
|
f = eina_file_open(mo_path, 0);
|
||||||
|
if (f) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -1843,10 +1848,13 @@ data_write_mo(Eet_File *ef, int *mo_num)
|
||||||
sub_str[1] = 'm';
|
sub_str[1] = 'm';
|
||||||
EINA_LIST_FOREACH(mo_dirs, ll, dir_path)
|
EINA_LIST_FOREACH(mo_dirs, ll, dir_path)
|
||||||
{
|
{
|
||||||
snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src);
|
|
||||||
snprintf((char *)po_path, sizeof(po_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, po_entry);
|
snprintf((char *)po_path, sizeof(po_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, po_entry);
|
||||||
if (ecore_file_exists(po_path))
|
if (ecore_file_exists(po_path))
|
||||||
{
|
{
|
||||||
|
char *mo_dir = ecore_file_dir_get(eet_file_get(ef));
|
||||||
|
snprintf((char *)mo_path, sizeof(mo_path), "%s/%s", mo_dir, mw->mo_entry->locale);
|
||||||
|
ecore_file_mkpath(mo_path);
|
||||||
|
snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", mo_dir, mw->mo_entry->locale, mw->mo_entry->mo_src);
|
||||||
snprintf(buf, sizeof(buf), "msgfmt -o %s %s", mo_path, po_path);
|
snprintf(buf, sizeof(buf), "msgfmt -o %s %s", mo_path, po_path);
|
||||||
mw2 = malloc(sizeof(Mo_Write));
|
mw2 = malloc(sizeof(Mo_Write));
|
||||||
if (mw2)
|
if (mw2)
|
||||||
|
@ -1857,9 +1865,10 @@ data_write_mo(Eet_File *ef, int *mo_num)
|
||||||
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
||||||
_exe_del_cb, mw2);
|
_exe_del_cb, mw2);
|
||||||
}
|
}
|
||||||
|
free(mo_dir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_and_abort(mw->ef, "Invalid .po file \"%s\".", po_path);
|
error_and_abort(mw->ef, "Non-existent .po file specified: \"%s\".", po_path);
|
||||||
}
|
}
|
||||||
free(mw);
|
free(mw);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue