forked from bartvdbraak/blender
Remove check for whether po folder exist
It was just a temp thing to not break stuff before final git migration.
This commit is contained in:
parent
09ecfc318c
commit
9c3586d9f9
23
SConstruct
23
SConstruct
@ -943,7 +943,6 @@ if env['OURPLATFORM']!='darwin':
|
|||||||
return (member in path.split(os.sep))
|
return (member in path.split(os.sep))
|
||||||
|
|
||||||
po_dir = os.path.join("release", "datafiles", "locale", "po")
|
po_dir = os.path.join("release", "datafiles", "locale", "po")
|
||||||
need_compile_mo = os.path.exists(po_dir)
|
|
||||||
|
|
||||||
for intpath in internationalpaths:
|
for intpath in internationalpaths:
|
||||||
for dp, dn, df in os.walk(intpath):
|
for dp, dn, df in os.walk(intpath):
|
||||||
@ -953,10 +952,7 @@ if env['OURPLATFORM']!='darwin':
|
|||||||
dn.remove('_svn')
|
dn.remove('_svn')
|
||||||
|
|
||||||
# we only care about release/datafiles/fonts, release/datafiles/locales
|
# we only care about release/datafiles/fonts, release/datafiles/locales
|
||||||
if check_path(dp, "locale"):
|
if check_path(dp, "fonts"):
|
||||||
if need_compile_mo and check_path(dp, "po"):
|
|
||||||
continue
|
|
||||||
elif check_path(dp, "fonts"):
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
@ -970,18 +966,17 @@ if env['OURPLATFORM']!='darwin':
|
|||||||
env.Execute(Mkdir(dir))
|
env.Execute(Mkdir(dir))
|
||||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||||
|
|
||||||
if need_compile_mo:
|
for f in os.listdir(po_dir):
|
||||||
for f in os.listdir(po_dir):
|
if not f.endswith(".po"):
|
||||||
if not f.endswith(".po"):
|
continue
|
||||||
continue
|
|
||||||
|
|
||||||
locale_name = os.path.splitext(f)[0]
|
locale_name = os.path.splitext(f)[0]
|
||||||
|
|
||||||
mo_file = os.path.join(B.root_build_dir, "locale", locale_name + ".mo")
|
mo_file = os.path.join(B.root_build_dir, "locale", locale_name + ".mo")
|
||||||
|
|
||||||
dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
|
dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
|
||||||
dir = os.path.join(dir, "datafiles", "locale", locale_name, "LC_MESSAGES")
|
dir = os.path.join(dir, "datafiles", "locale", locale_name, "LC_MESSAGES")
|
||||||
scriptinstall.append(env.InstallAs(os.path.join(dir, "blender.mo"), mo_file))
|
scriptinstall.append(env.InstallAs(os.path.join(dir, "blender.mo"), mo_file))
|
||||||
|
|
||||||
#-- icons
|
#-- icons
|
||||||
if env['OURPLATFORM']=='linux':
|
if env['OURPLATFORM']=='linux':
|
||||||
|
@ -326,51 +326,41 @@ if(WITH_INTERNATIONAL)
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
|
set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
|
||||||
|
set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale)
|
||||||
|
|
||||||
if(EXISTS "${_locale_dir}/po")
|
file(GLOB _po_files "${_locale_dir}/po/*.po")
|
||||||
set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale)
|
foreach(_po_file ${_po_files})
|
||||||
|
msgfmt_simple(${_po_file} _all_mo_files)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
file(GLOB _po_files "${_locale_dir}/po/*.po")
|
# Create a custom target which will compile all po to mo
|
||||||
foreach(_po_file ${_po_files})
|
add_custom_target(
|
||||||
msgfmt_simple(${_po_file} _all_mo_files)
|
locales
|
||||||
endforeach()
|
DEPENDS ${_all_mo_files})
|
||||||
|
|
||||||
# Create a custom target which will compile all po to mo
|
add_dependencies(blender locales)
|
||||||
add_custom_target(
|
|
||||||
locales
|
|
||||||
DEPENDS ${_all_mo_files})
|
|
||||||
|
|
||||||
add_dependencies(blender locales)
|
# Generate INSTALL rules
|
||||||
|
install(
|
||||||
|
FILES ${_locale_dir}/languages
|
||||||
|
DESTINATION ${_locale_target_dir}
|
||||||
|
)
|
||||||
|
|
||||||
# Generate INSTALL rules
|
foreach(_mo_file ${_all_mo_files})
|
||||||
|
get_filename_component(_locale_name ${_mo_file} NAME_WE)
|
||||||
install(
|
install(
|
||||||
FILES ${_locale_dir}/languages
|
FILES ${_mo_file}
|
||||||
DESTINATION ${_locale_target_dir}
|
DESTINATION ${_locale_target_dir}/${_locale_name}/LC_MESSAGES
|
||||||
|
RENAME blender.mo
|
||||||
)
|
)
|
||||||
|
unset(_locale_name)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
foreach(_mo_file ${_all_mo_files})
|
unset(_all_mo_files)
|
||||||
get_filename_component(_locale_name ${_mo_file} NAME_WE)
|
unset(_po_files)
|
||||||
install(
|
unset(_po_file)
|
||||||
FILES ${_mo_file}
|
unset(_mo_file)
|
||||||
DESTINATION ${_locale_target_dir}/${_locale_name}/LC_MESSAGES
|
unset(_locale_target_dir)
|
||||||
RENAME blender.mo
|
|
||||||
)
|
|
||||||
unset(_locale_name)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
unset(_all_mo_files)
|
|
||||||
unset(_po_files)
|
|
||||||
unset(_po_file)
|
|
||||||
unset(_mo_file)
|
|
||||||
unset(_locale_target_dir)
|
|
||||||
else()
|
|
||||||
install(
|
|
||||||
DIRECTORY
|
|
||||||
${_locale_dir}
|
|
||||||
DESTINATION ${TARGETDIR_VER}/datafiles
|
|
||||||
PATTERN ".svn" EXCLUDE
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
unset(_locale_dir)
|
unset(_locale_dir)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user