Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic housekeeping #5

Closed
wants to merge 9 commits into from
Closed

Conversation

simnalamburt
Copy link

@simnalamburt simnalamburt commented Dec 24, 2016

Hi, my name is Hyeon Kim. And I'm currently translating this game in Korean with @xnuk. But we noticed that this game cannot be properly run under CJK environment, so I made some basic housekeeping changed before we start translation.

  1. Strip trailing whitespaces

    Trailing whitespaces are redundant and causes meaningless diffs with some editors. Removing it.

  2. Add line feed at the end of files

    By the POSIX standard, all text files should contain "newline" at the end of file. Adding it.

    References
    1. Answer of "Why should text files end with a newline?" question
    2. POSIX standard document
  3. Add <!DOCTYPE html> in front of the page

    Since this game uses WebGL and <canvas>, the index.html should be declared as a HTML5 document
    but it does not. Explicitly specifying it by adding docstring in front of the index.html

  4. Add an .editorconfig file

    EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. See http://editorconfig.org for the further information

  5. Specify index.html's encoding as UTF-8

    Currently index.html does not have <meta charset> tag. It will prevent CJK users from seeing their own language properly. We need it.

  6. Remove BOM

    The Unicode Standard permits the BOM in UTF-8, but does not require or recommend its use. Byte order has no meaning in UTF-8. Removing it.

    Reference
  7. Unify the indentation

    The indentation rules in the source code were mixed with tabs and spaces * 4. Unifying it with tabs.

Translation is working in progress at korean branch of simnalamburt/wbwwb-kr.

I used the command below:

    find . -not \( \
       -name "*.mp3" -prune -o \
       -name "*.png" -prune -o \
       -name "*.ttf" -prune -o \
       -name .svn -prune -o \
       -name .git -prune \
    \) -type f -print0 | \
        xargs -0 sed -i "s/[[:space:]]*$//"
I used the command below:

    find . -not \( \
       -name "*.mp3" -prune -o \
       -name "*.png" -prune -o \
       -name "*.ttf" -prune -o \
       -name .svn -prune -o \
       -name .git -prune \
    \) -type f -print0 | \
        xargs -0 sed -i '$a\'

References:
  http://stackoverflow.com/a/729795
  http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
EditorConfig helps developers define and maintain consistent coding
styles between different editors and IDEs.

Reference:
  http://editorconfig.org/
The Unicode Standard permits the BOM in UTF-8, but does not require or
recommend its use.

Reference:
  https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
  http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf
The indentation rules in the source code were mixed with tabs and
spaces * 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant