You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

i18n.sh 1.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # Usage:
  3. # Initial catalog creation (lang is the language identifier):
  4. # ./i18n.sh lang
  5. # Updating translation and compile catalog:
  6. # ./i18n.sh
  7. # configuration
  8. DOMAIN="kotti_ai"
  9. SEARCH_PATH="kotti_ai"
  10. LOCALES_PATH="kotti_ai/locale"
  11. # end configuration
  12. # create locales folder if not exists
  13. if [ ! -d "$LOCALES_PATH" ]; then
  14. echo "Locales directory not exists, create"
  15. mkdir -p "$LOCALES_PATH"
  16. fi
  17. # create pot if not exists
  18. if [ ! -f "$LOCALES_PATH"/$DOMAIN.pot ]; then
  19. echo "Create pot file"
  20. touch "$LOCALES_PATH"/$DOMAIN.pot
  21. fi
  22. # no arguments, extract and update
  23. if [ $# -eq 0 ]; then
  24. echo "Extract messages"
  25. pot-create "$SEARCH_PATH" -d $DOMAIN -o "$LOCALES_PATH"/$DOMAIN.pot
  26. echo "Update translations"
  27. for po in "$LOCALES_PATH"/*/LC_MESSAGES/$DOMAIN.po; do
  28. msgmerge --no-wrap -o "$po" "$po" "$LOCALES_PATH"/$DOMAIN.pot
  29. done
  30. echo "Compile message catalogs"
  31. for po in "$LOCALES_PATH"/*/LC_MESSAGES/*.po; do
  32. echo "Compiling file $po..."
  33. msgfmt --statistics -o "${po%.*}.mo" "$po"
  34. done
  35. # first argument represents language identifier, create catalog
  36. else
  37. cd "$LOCALES_PATH"
  38. mkdir -p $1/LC_MESSAGES
  39. msginit -i $DOMAIN.pot -o $1/LC_MESSAGES/$DOMAIN.po -l $1
  40. fi

kotti_ai是AI+互联网企业级应用软件包,通过web技术,将基于飞桨Paddle Serving框架和 MindSpore Serving的AI应用更好的呈现出来,解决AI实际部署落地难、AI技术提供商与最终用户互通难的问题,实现AI部署、落地、上线以及推广一条龙解决方案!

Contributors (1)