gettext는 말그대로 text를 get하는 utility/function 이다.
어떤 용도로 사용하냐면은, 다국어지원등의 용도로 사용된다.

메시지들은 msgid를 통해 불러 오게되고,
gettext를 통해 받아온 메시지는, 현재 system의 언어설정에 따라 맞는 언어를 가져 온다.

#include <libintl.h>
#include <locale.h>
#include <stdio.h>

int main(void)
{
        /* 현재 호스트의 locale 을 사용한다. */
        setlocale(LC_ALL,"");
        /* Hello 의 message table 을 /usr/local/share/locale 아래에서 찾도록 한다. */
        bindtextdomain("Hello", "/usr/local/share/locale");

        textdomain("Hello");
   
        printf("original message : %s\n", "Greeting");
        printf("gettext trans  : %s\n", gettext("Greeting"));

        printf("original message : %s\n", "Hello");
        printf("gettext trans  : %s\n", gettext("Hello"));

        printf("original message : %s\n", "World!");
        printf("gettext trans  : %s\n", gettext("World!"));

       return 0;
}

아무튼, 리눅스나, 윈도우 상에서 이러한 po파일을 수정하고 만드는 건 꽤나 번거로운 작업이지만,
다국어 작업을 해야한다면 꽤 괜찮은 방법이라고 생각된다.



[링크 : http://wiki.kldp.org/wiki.php/DocbookSgml/Gettext-KLDP] Howto Document
[공식 : http://www.gnu.org/software/gettext/] GNU gettext official
[Poedit : http://www.poedit.net/] GUI Po Editor

'프로그램 사용 > poEdit' 카테고리의 다른 글

poEdit의 TM을 이용한 자동번역  (0) 2011.12.23
poedit - Translate memory 도움말 번역  (0) 2011.12.21
L10N / I18N  (0) 2009.04.08
Poedit - crossplatform gettext catalogs editor  (0) 2009.02.26
Posted by 구차니
프로그램 사용2009. 3. 6. 16:09
UFO:AI 번역을 하다 보니 이넘의 죽일넘의 영어 때문에, 무료 영어사전을 찾게 되었다.
구글에서 검색해보니 두개 정도가 눈에 띄어서 일단 사용해 보았다.

두가지 전부 기본값으로 'ctrl-우클릭'으로 자동 단어 검색을 지원한다.


WordWeb은 offline으로 사용이 가능한 사전이다.
Wikipedia의 경우 인터넷이 될 때 사용하면되고, 무료 버전의 광고 내용은 다음과 같다.

Definitions and synonyms
Proper nouns
Related words
Pronunciations
150 000 root words
120 000 synonym sets
Fixed web reference tabs

먼지는 몰라도.. 생각보다 단어수가 많다.
About에 프린스턴 대학이 어쩌구 저쩌구 라고 되어 있다. 자체제작 사전인 듯 하다.
2009년 3월 6일 기준, 최신버전의 인스톨러 크기는 7.44MB (7,803,496 바이트)






LINGOES는 번역/사전 프로그램이다
사전은 에센셜 영어사전을 내장하고 있다. (우리가 아는 그 에센셜인가 -ㅁ-?)
번역의 경우 구글번역을 통하고, 단어 검색시에도 구글의 사전 검색을 끌어온다. portable 버전을 제공하는것이 장점이다.
WordWeb에 비하면 상당히 깔끔하고 한글화도 부분적으로 되어있다(메뉴)



ctrl-우클릭시 팝업으로 뜬다.

2009년 3월 6일 기준, 최신버전의 인스톨러 크기는 4.54MB (4,767,383 바이트)
premium dictionary를 다운받아 설치 가능하다. 잘 찾아 보면 한영/영한 사전도 있다.
[사전 다운로드 : http://www.lingoes.net/en/dictionary/]



결론 :
WordWeb은 기본 단어가 풍부하고, Lingoes는 빈약하다,
예를들어 sigma라는 단어조차도 Lingoes 기본 단어 사전에는 나오지 않는다.

하지만 UI라던가 편의성에서는 Lingoes가 앞선다.
예를들어, Ctrl-우클릭의 경우 WordWeb은 프로그램을 다시 띄워서 보여주지만(가뜩이나 UI도 안이쁜데 ^^;)
Lingoes는 다른 UI의 팝업을 띄워준다.

그리고 윈도우 시작시 자동실행은 WordWeb의 경우에는 강제적이고, 끄는 옵션이 존재하지 않는다.
Lingoes는 설정메뉴에 끄는 옵션이 존재하는데 비해서, WordWeb의 이러한 차이는 상당히 아쉬움으로 남는다.

결론만 이야기 하자면, Lingoes에 여러가지 사전을 다운 받아 사용하는것이 좋을 듯 하지만,
이넘의 다운로드 링크가 잘 안열리는 문제가 있기 때문에, 조금 번거로운 감이 없진 않다.


[WordWeb : http://wordweb.info/]
[lingoes : http://www.lingoes.net/]
Posted by 구차니
CVS만 2년 정도 사용했다.
물론 branch 까지는 사용해보지 않았고,
주로 사용하던 기능은 history와 tag 뿐이었다.

아무튼 이렇게 CVS만 쓰다가 SVN을 사용해봤는데,
처음 사용할때의 어색함인지, 상당히 다른 느낌이 든다.

일단 CVS는 module 단위였는데 SVN은 그러한 구분이 없다는 사실.
어쩌면 구형 TortoiseCVS를 사용해서 그럴지도 모르겠다는 생각이 든다.
신형 TortoiseCVS의 경우에는 물론 module단위로 만들기는 하지만,
module 목록을 combobox가 아닌 listbox로 보여 주기 때문에, 기존 버전보다는
확연히 구분되어 있다는 느낌이 적게 들었다.

하지만, SVN은 이러한 '프로젝트'의 느낌보다는, 이력이 남는 '파일 저장소'라는 느낌이 강하게 든다.
(아마 파일 이동의 편의성과, checkout시 URL로 입력하는 특성때문일 것이다)


CVS 구버전 UI

CVS 신버전 UI

Posted by 구차니
UFO:AI 한글화 프로젝트 참여중인데, SVN의 사용은 처음이라 이래저래 적응이 안된다.
가장 큰 것으로는
CVS의 history라는 것이 SVN에서는 Show Log로 바뀌었다는 것이다.
그리고 SVN은 하나의 커밋이나 수정사항이 있을때, 전체의 리비전이 변경되므로,
파일 각각이 아닌 SVN repository 전체에 대한 Log가 존재하게 된다
(사용이 미숙해서 그럴지도 모르지만 TortoiseCVS에서는 파일 단위로 밖에 보지 못했다)

Context-menu 이다. 주로 사용하는 것은
프로젝트 전체의 업데이트인 SVN Update와
프로젝트 전체의 수정 업로드인 SVN Commit 그리고
프로젝트의 변경사항을 볼수 있는 Show Log 이다.

위의 이미지는 프로젝트 전체의 Show Log 결과이다.
프로젝트에서 추가 / 삭제된 파일등과 전체의 Revision이 표기된다.

자막 번역 파일 하나의 내역이다. 자세히 보면 알겠지만, Revision이 1씩 증가하지 않는다.
리비전에서 변동사항이 있을 수도 있고, 없을 수도 있기 때문에, 파일을 Show Log 하면
위와 같이 나오지 않는 사항들을 볼 수 있다.
Posted by 구차니
프로그램 사용/vi2009. 3. 3. 18:39
:%!xxd
:%!xxd -r <-- 원 상태로 복귀

VI에서 바이너리를 열어 HEX 모드로 보는 방법

[출처 : http://k.daum.net/qna/view.html?category_id=QCE003&qid=00gOz&q=hex+editor&srchid=NKS00gOz]
Posted by 구차니
CollabNet Subversion Server and Client v1.5.5 (for Windows) 를 다운로드 하려면 가입이 필요하다.

설치 화면은 간단한데 svnserve와 apache용 MOD_DAV_SVN을 옵션으로 고를 수 있다.

svn 서버 설정화면으로 포트와 repository를 정해주면 된다.

설치를 완료 하면 자동으로 c:\svn_repository 가 생성된다.
하지만 내용이 하나도 없어서 svn이 접근을 하지 못한다는 에러가 발생한다.

그리고 "Install svnserve to run as Windows service" 일뿐, service가 실행되지는 않는다.
물론 리부팅하면 자동으로 시작이 되긴하겠지만, 설치 직후 안된다면 service가 실행시켜 주면 된다.


authorization failed가 뜨면 아래의 링크를 참조하여 해결하면 된다.

5) Configure permissions for the repository

  • Open with notepad the repository configuration C:\SVNREPOSITORY\conf\svnserve.conf
    and paste just the following lines (remove everything else):
    [general]
    anon-access = none
    auth-access = write
    password-db = passwd.conf
    authz-db = authz.conf
    #realm = My First Repository

    Please note that I renamed "passwd" to "passwd.conf" and "authz" to "authz.conf" both
    in the config file here, and in the filesystem too, so I can just associate the conf extension with notepad and make my life easier.

    Note also that when a realm is not specified, it will be assumed to be the repository guid (created when you created repository). Realms should be unique among different repositories, unless you want to share the same permissions among them.
  • Rename authz to authz.conf
  • Rename passwd to passwd.conf
  • Open passwd.conf with notepad and put some users/passwords by pasting the following lines (remove everything else):
    [users]
    admin = qwerty147
    ricardo = pwd123
    marcelo = pwd456
    joao = pwd789
  • Now open authz.conf with notepad and paste just the following lines (remove everything else):
    # guests will have read permission in all repository
    # writers must include all non-admin users who must have write
    #    permission on some folder (read permission on root is needed for that)
    [groups]
    admins = admin, ricardo
    writers = marcelo
    guests = joao
    project1 = marcelo

    [/]
    @admins = rw
    @writers = r
    @guests = r
    * =

    # please note that permissons (ex: admins group) don't propagate from root to subprojects
    [/Project1]
    @project1 = rw
    @admins = rw
    * =
  • Now you can try again mkdir:
    C:\>svn mkdir svn://localhost/Products
    Authentication realm: e9852c7c-f11f-1946-b4a8-49fa8b53a267
    Password for 'Ricardo': ******


    Please note that it will by default assume your username is the same as your windows login. If it is not, just put any password, and it will ask you for your correct username.
  • If everything went ok you will get a message like "Committed revision 1"

    Congratulations! You have made your first change to the repository.

    Now let's create another folder: C:\> svn mkdir svn://localhost/Projects
    The password won't be asked this time, because it's cached for your user (Documents and settings\username\Application Data\Subversion\auth\)

[출처 : http://www.smarter-technologies.com/smarter/Default.aspx?tabid=128&EntryID=12]

svn_repository의 내부 구조 & conf 내용물들

svnserve.conf의 기본 내용. 전부 주석처리다 ㄱ-

passwd는 사용하는 계정에 대한 아이디/암호를 저장한다.

이녀석은.. 아무튼 인증파일이다. 특정 리파지터리에 특정 유저의 권한을 설정한다.



심심해서 해본 뻘짓

[다운로드 : http://www.collab.net/downloads/subversion/] <- 가입필요
[다운로드 : http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91]

'프로그램 사용 > Version Control' 카테고리의 다른 글

CVS / SVN 차이점?  (2) 2009.03.06
SVN 사용기  (0) 2009.03.05
TortoiseSVN 사용하기  (2) 2009.02.26
TortoiseSVN - Svnserve Based Server  (5) 2009.02.26
cvs 서버 설치 / 복원  (2) 2009.01.22
Posted by 구차니
CVS의 경우는 CVSNT 와 TortoiseCVS로 서버 및 클라이언트 환경을 구축할 수 있다.
하지만 SVN의 경우는 TortoiseSVN만으로도 서버를 구축 할 수 있다.
물론 svn:// 으로 접속은 하지 못할지라도 말이다(아직 설정법을 모르니 혹시 모름)

ToroiseSVN을 설치 하면 다음과 같은 context-menu가 생긴다(현재 빵집/CVS/SVN/WinMerge가 설치되어 있다)

CVS에서도 그러했 듯, SVN에서도 repository는 있어야 한다.
아무것도 없는 빈 폴더를 하나 만들고, 그 안에서 Create repository here를 눌러준다.

아래의 파일들이 생성되며 repository가 생성되었다는 메시지가 뜬다.
d:\svn_repo 라는 경로로 생성했다.

일단은 SVN에 저장할 파일을 찾아본다. 원하는 폴더를 클릭해서 Import 한다.

Import 에서는 저장할 repository의 경로를 넣어준다.
위에서 d:\svn_repo에 저장소를 생성했으므로 file://d:/svn_repo가 URL이 된다.

import가 완료되었다.
(repository에 파일이 Add 되었다)

저장소에 넣었으니(import) 이제 저장소에서 꺼내오자(checkout)
경로는 저장한 경로와 동일하게 넣어 주고, 받아와서 저장할 경로를 지정해 준다.
아까는 경로를 지정해 주지 않았으므로 받을 곳에 디렉토리를 하나 추가해준다.

checkout 장소에 파일이 Add 되었다.

SVN 클라이언트가 있으면 체크가 생긴다. 녹색은 서버와 동일하다는 의미이다.
빨간색은 서버와 동일하지 않은 내용이 담겨 있다는 의미이다.

TortoiseSVN의 가장 강력한 점은 바로 Repositoty Broswer가 아닐까 생각이 된다.
원래 file://d:\svn_repo에 존재하던 po 파일들을, Create Folder를 사용하여 po를 만들고
단순하게 드래그 해서 po로 넣었더니 간단하게 이동이 되었다.
CVS는 경로이동이 불가능 한 단점이 있는데 SVN은 이렇게 편하게 이동 할 수 있다.

TortoiseSVN에 내장된 Merge 툴이다.

Checkout 창에서 Show Log를 누르면 뜨는 창
revision은 cvs는 파일별로 생겼지만, svn은 전체 저장소에 대해서 생성이 된다.
어떻게 보면 더욱 좋은것이, 태그의 확장 판으로 어떠한 행동을 했었는지 추적이 가능하고
그 때 이후의 버전을 세부적으로 받아 올수 있다. 이러한 작업은 CVS에서는 매번 tag를 해야만 가능하다.

위의 창에서 통계를 누른 모습이다. cvs에서는 역시 볼 수 없었던 기능이다.


예전부터 설치만 해 놓고 쓰지 않던 svn을 끄집어 내서 한번 서버 설치를 해보려니 결국은 또 실패로 돌아 갔다.
하지만 이렇게 클라이언트/ 개인용 서버로 사용하는 법이라도 알았으니 위안으로 삼고,
다음번 문서에 svnserve로 공용 서버 만드는 법만 추가 하면 될 듯하다.
Posted by 구차니
프로그램 사용/poEdit2009. 2. 26. 00:23
어우 깜놀~! 심심해서 SVN 언어팩 설치 하다가 많이 보던 녀석이 눈에 띄었다.
생각해보니 Poedit 이라는 GNU 다국어지원 프로그램으로 생성되는 확장자이다.
po 라는 text 기반 파일이 컴파일 되어 mo 파일이 생성이 된다.

SVN 언어팩 설치 하면서 생긴 폴더들과 파일

Poedit을 실행한 화면, 예제는 번역중인 UFO:AI의 영문파일이다.

번역중인 UFO:AI의 po 소스 파일 디렉토리이다. pot는 po template로 파워포인트 서식 파일이 아니다.
이 파일을 기반으로 po를 생성해주며, 이파일을 컴파일 하면 mo가 된다.

[공식 : http://www.poedit.net/]

'프로그램 사용 > poEdit' 카테고리의 다른 글

poEdit의 TM을 이용한 자동번역  (0) 2011.12.23
poedit - Translate memory 도움말 번역  (0) 2011.12.21
L10N / I18N  (0) 2009.04.08
gettext - multi language support  (2) 2009.03.09
Posted by 구차니
솔찍히 내가 TortoiseCVS Client for Windows에 쩔어 있어서
콘솔에서 명령어로 체크아웃 할지도 모르고, SVN에는 손이 가지 않는다.

SVN의 장점으로는 디렉토리 이동 등이 있다는 것도 알고,
CVS에서 SVN으로 이전도 그리 어렵지는 않다고 하지만,

가장 큰 문제는, 나 혼자 사용하는 SVN 서버가 아닌
다른 사람들도 접속할 수 있는 SVN 서버를 만드는 법을 모른다는 것이다.

아무튼! 용기를 내서 한번 문서를 뒤적이다가 발견했는데..
TortoiseSVN Client for Windows help에 있었다.. OTL 역시 등불밑이 가장 어두운 것인가..


키워드는 svnserve 이다.

Running svnserve

Now that svnserve is installed, you need it running on your server. The simplest approach is to run the following from a DOS shell or create a windows shortcut:

svnserve.exe --daemon

svnserve will now start waiting for incoming requests on port 3690. The --daemon switch tells svnserve to run as a daemon process, so it will always exist until it is manually terminated.

If you have not yet created a repository, follow the instructions given with the Apache server setup the section called “Configuration”.

To test that svnserve is working, use TortoiseSVNRepo-Browser to view a repository.

Assuming your repository is located in c:\repos\TestRepo, and your server is called localhost, enter:

svn://localhost/repos/TestRepo

when prompted by the repo browser.

You can also increase security and save time entering URLs with svnserve by using the --root switch to set the root location and restrict access to a specified directory on the server:

svnserve.exe --daemon --root drive:\path\to\repository\root

Using the previous test as a guide, svnserve would now run as:

svnserve.exe --daemon --root c:\repos

And in TortoiseSVN our repo-browser URL is now shortened to:

svn://localhost/TestRepo

Note that the --root switch is also needed if your repository is located on a different partition or drive than the location of svnserve on your server.

Svnserve will service any number of repositories. Just locate them somewhere below the root folder you just defined, and access them using a URL relative to that root.


Run svnserve as a Service

Running svnserve as a user is usually not the best way. It means always having a user logged in on your server, and remembering to restart it after a reboot. A better way is to run svnserve as a windows service. Starting with Subversion 1.4, svnserve can be installed as a native windows service.

To install svnserve as a native windows service, execute the following command all on one line to create a service which is automatically started when windows starts.

sc create svnserve binpath= "c:\svnserve\svnserve.exe --service 
--root c:\repos" displayname= "Subversion" depend= tcpip
start= auto

If any of the paths include spaces, you have to use (escaped) quotes around the path, like this:

sc create svnserve binpath= "
\"C:\Program Files\Subversion\bin\svnserve.exe\"
--service --root c:\repos" displayname= "Subversion"
depend= tcpip start= auto

You can also add a description after creating the service. This will show up in the Windows Services Manager.

sc description svnserve "Subversion server (svnserve)"

Note the rather unusual command line format used by sc. In the key= value pairs there must be no space between the key and the = but there must be a space before the value.




[출처 : http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-svnserve.html]
Posted by 구차니
프로그램 사용2009. 2. 25. 10:58
그러고 보니.. 스킨을 항상 기본 스킨으로 만 사용을 했었다. 귀찮은것도 있고, 익숙하니까.
아무튼, 간만에 스킨이라는 녀석을 사용하기 위해서 Winamp lite 버전에서 Full버전으로 까지 업그레이드를
단행할정도로 심하게 뽐뿌질이 왔다.


대충 그려 만든 듯한 스킨인데 꽤나 마음에 든다.
근데.. 이퀄라이저는 정말 처음에는 어떻게 써야 하나 고심을 ^^;

[링크 : http://www.winamp.com/skins/details/144550]
Posted by 구차니