Changeset View
Changeset View
Standalone View
Standalone View
src/bin/edje/edje_cc_out.c
Show First 20 Lines • Show All 1715 Lines • ▼ Show 20 Line(s) | 1712 | { | |||
---|---|---|---|---|---|
1716 | 1716 | | |||
1717 | char *dir_path = NULL; | 1717 | char *dir_path = NULL; | ||
1718 | char mo_path[PATH_MAX]; | 1718 | char mo_path[PATH_MAX]; | ||
1719 | char moid_str[50]; | 1719 | char moid_str[50]; | ||
1720 | Eina_File *f = NULL; | 1720 | Eina_File *f = NULL; | ||
1721 | void *m = NULL; | 1721 | void *m = NULL; | ||
1722 | int bytes = 0; | 1722 | int bytes = 0; | ||
1723 | 1723 | | |||
1724 | // Search the mo file in all the -md ( mo directory ) | 1724 | if (mw->mo_path) | ||
1725 | EINA_LIST_FOREACH(mo_dirs, ll, dir_path) | 1725 | f = eina_file_open(mw->mo_path, 0); | ||
1726 | if (!f) | ||||
1726 | { | 1727 | { | ||
1727 | snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src); | 1728 | // Search the mo file in all the -md ( mo directory ) | ||
1728 | f = eina_file_open(mo_path, 0); | 1729 | EINA_LIST_FOREACH(mo_dirs, ll, dir_path) | ||
1729 | if (f) break; | 1730 | { | ||
1731 | snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src); | ||||
1732 | f = eina_file_open(mo_path, 0); | ||||
1733 | if (f) break; | ||||
1734 | } | ||||
1730 | } | 1735 | } | ||
1731 | if (!f) | 1736 | if (!f) | ||
1732 | { | 1737 | { | ||
1733 | snprintf((char *)mo_path, sizeof(mo_path), "%s", mw->mo_entry->mo_src); | 1738 | snprintf((char *)mo_path, sizeof(mo_path), "%s", mw->mo_entry->mo_src); | ||
1734 | f = eina_file_open(mo_path, 0); | 1739 | f = eina_file_open(mo_path, 0); | ||
1735 | } | 1740 | } | ||
1736 | 1741 | | |||
1737 | if (f) using_file(mo_path, 'S'); | 1742 | if (f) using_file(mo_path, 'S'); | ||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 1834 | { | |||
1838 | po_entry = strdup(mw->mo_entry->mo_src); | 1843 | po_entry = strdup(mw->mo_entry->mo_src); | ||
1839 | sub_str = strstr(mw->mo_entry->mo_src, ".po"); | 1844 | sub_str = strstr(mw->mo_entry->mo_src, ".po"); | ||
1840 | 1845 | | |||
1841 | if (sub_str) | 1846 | if (sub_str) | ||
1842 | { | 1847 | { | ||
1843 | sub_str[1] = 'm'; | 1848 | sub_str[1] = 'm'; | ||
1844 | EINA_LIST_FOREACH(mo_dirs, ll, dir_path) | 1849 | EINA_LIST_FOREACH(mo_dirs, ll, dir_path) | ||
1845 | { | 1850 | { | ||
1846 | snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, mw->mo_entry->mo_src); | | |||
1847 | snprintf((char *)po_path, sizeof(po_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, po_entry); | 1851 | snprintf((char *)po_path, sizeof(po_path), "%s/%s/%s", dir_path, mw->mo_entry->locale, po_entry); | ||
1848 | if (ecore_file_exists(po_path)) | 1852 | if (ecore_file_exists(po_path)) | ||
1849 | { | 1853 | { | ||
1854 | char *mo_dir = ecore_file_dir_get(eet_file_get(ef)); | ||||
1855 | snprintf((char *)mo_path, sizeof(mo_path), "%s/%s", mo_dir, mw->mo_entry->locale); | ||||
1856 | ecore_file_mkpath(mo_path); | ||||
1857 | snprintf((char *)mo_path, sizeof(mo_path), "%s/%s/%s", mo_dir, mw->mo_entry->locale, mw->mo_entry->mo_src); | ||||
1850 | snprintf(buf, sizeof(buf), "msgfmt -o %s %s", mo_path, po_path); | 1858 | snprintf(buf, sizeof(buf), "msgfmt -o %s %s", mo_path, po_path); | ||
1851 | mw2 = malloc(sizeof(Mo_Write)); | 1859 | mw2 = malloc(sizeof(Mo_Write)); | ||
1852 | if (mw2) | 1860 | if (mw2) | ||
1853 | { | 1861 | { | ||
1854 | memcpy(mw2, mw, sizeof(Mo_Write)); | 1862 | memcpy(mw2, mw, sizeof(Mo_Write)); | ||
1855 | mw2->mo_path = strdup(mo_path); | 1863 | mw2->mo_path = strdup(mo_path); | ||
1856 | mw2->exe = ecore_exe_run(buf, mw2); | 1864 | mw2->exe = ecore_exe_run(buf, mw2); | ||
1857 | ecore_event_handler_add(ECORE_EXE_EVENT_DEL, | 1865 | ecore_event_handler_add(ECORE_EXE_EVENT_DEL, | ||
1858 | _exe_del_cb, mw2); | 1866 | _exe_del_cb, mw2); | ||
1859 | } | 1867 | } | ||
1868 | free(mo_dir); | ||||
1860 | } | 1869 | } | ||
1861 | else | 1870 | else | ||
1862 | error_and_abort(mw->ef, "Invalid .po file \"%s\".", po_path); | 1871 | error_and_abort(mw->ef, "Non-existent .po file specified: \"%s\".", po_path); | ||
1863 | } | 1872 | } | ||
1864 | free(mw); | 1873 | free(mw); | ||
1865 | } | 1874 | } | ||
1866 | else | 1875 | else | ||
1867 | { | 1876 | { | ||
1868 | if (threads) | 1877 | if (threads) | ||
1869 | ecore_thread_run(data_thread_mo, data_thread_mo_end, NULL, mw); | 1878 | ecore_thread_run(data_thread_mo, data_thread_mo_end, NULL, mw); | ||
1870 | else | 1879 | else | ||
▲ Show 20 Lines • Show All 2890 Lines • Show Last 20 Lines |