This is bb94, and I am going to show you how to create language packs easily!
Conventions: I will use forward slashes ("/") for directory paths. If you're using Windows, use back slashes instead ("\").
Note 1: Use the new 1.6 snapshots, not 1.5.
Versions before 13w16a required modification of the minecraft.jar file. Versions from 13w16a have a directory in which you can pop in language packs and have them show in the Languages menu.
Now let's get started.
First, create a new folder somewhere, presumably called lang. If this is the first time using the 1.6 snapshots, then after launching the game, the English pack will be in .minecraft/assets/lang. Move assets/lang/en_US.lang to your lang folder, then copy that into the same folder and rename it something that makes sense, followed by the three letters "dev."
If you are playing a different version than the first snapshot that you played from your new launcher, you need to go to versions/(current version)/minecraft.jar, open the archive, and retrieve lang/en_US.lang. (In Windows, changing the extension to .zip while having file extensions shown should work; I think Linux has an archive tool that works with .jars.) Copy it to your personal language folder.
It is advisable to base off your development pack off of en_US.lang. (We'll learn how to remove the translations identical to those of en_US.lang. Which brings us to the next point:
Note 2: Don't use Notepad.
The built-in language packs use Unix-style returns (i. e. they use "\n" instead of "\n\r" for Windows), and Notepad won't be able to display them. I personally use jEdit. If you're starting from scratch (which I wouldn't suggest), Notepad is fine.
Once you have the editing window on the newly copied file, you should see that the names the code uses internally appears to the left of the equals sign. Don't change them. Change the strings to the right instead. If you want to insert comments, use a pound sign ("#") at the beginning of the line.
A percent sign means a formatting field: %s means a string, %d means an integer, and %.2f means a floating-point number. If there are multiple fields of the same type, then they may be distinguished by having a number (starting with 1) and a dollar sign so the order of the fields can be reversed (e. g. "%1$s was slain by %2$s"). Note: save with UTF-8 encoding.
Once you've changed some fields, you will want to remove the default translations, or you'd be breaching Mojang's ToS. I wrote a little program in C to do that.
/* Accepts the name of a language file, that of its basis,
and an output name, and outputs into the file with the
name of the third argument all lines in the primary
language file that does not match those of the basis.
Assumes each line is unique and ignores blank or
commented lines.*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
char text[1020];
void* next;
} LinkedList;
int found=0;
int read_line(FILE* f, char* buff, int limit) {
int i=0;
char c;
do {
c=fgetc(f);
if (++i==(limit-1)) return 0;
*(buff++)=c;
} while (c && (c!='\n'));
*buff=0;
return 1;
}
int find_and_remove(LinkedList* l, char* query) {
LinkedList* n=(LinkedList*)l->next;
if (!n) {
if (found) {
found=0;
return 1;
}
else return 0;
}
if (!strcmp(query, n->text)) {
l->next=n->next;
free(n);
found=1;
}
find_and_remove((LinkedList*)l->next, query);
}
void free_list(LinkedList* l) {
if (l->next) free_list(l->next);
free(l);
}
int main(int argc, char** args) {
if (argc!=4) exit(EXIT_FAILURE);
char* c1=malloc(1024);
FILE* lang=fopen(args[1],"r");
FILE* basis=fopen(args[2],"r");
FILE* output=fopen(args[3],"w");
LinkedList* l=malloc(sizeof(LinkedList));
LinkedList* current=l;
while (!feof(basis)) {
read_line(basis,current->text,1020);
if (!(*current->text) || (*current->text == '#')) continue;
LinkedList* new=malloc(sizeof(LinkedList));
current->next=new;
current=new;
}
current->next=NULL;
while (!feof(lang)) {
read_line(lang,c1,1020);
if (!find_and_remove(l,c1))
fputs(c1,output);
}
free_list(l);
free(c1);
fclose(lang);
fclose(basis);
fclose(output);
printf("Success!");
exit(EXIT_SUCCESS);
}
Note: this program has a bug in which a bunch of umlauted y's (ÿ) come at the end of the file. Having the last line be a comment is a nice workaround; you can also remove them manually.
It is also useful to have a batch file (or shell script) to automate the publishing process. Assuming that your development pack is ncs_AAdev.lang and you want the finished pack to be called ncs_AA.lang, your batch file will be like this:
If you're using Linux, the shell script will be different, but similar in what it does. (It runs the program above, then copies it to the appropriate directory.)
Now some tips on translation itself.
Plan your language in some degree.
Plan to have a large vocabulary.
Try to translate some strings creatively. (death.attack.outOfWorld=%1$s enara carsyd esaer iss Acrynalos; %1$s fell into the Darkness; potion.prefix.grenade=Re-an-Pertene-Cenegryd; That-One-Can-Throw; a way to circumvent limitations)
Acknowledge limitations, but try to circumvent them.
Note that the possible lack of present participles may trouble you.
Most of the tips for the above section applies, but:
Know the said language well.
Keep your audience in mind. Make sure that they'll understand especially the achievements (you've probably heard of Portal and how it has to do with "The Lie", but people speaking other languages might not).
Note 1: Use the new 1.6 snapshots, not 1.5.
Versions before 13w16a required modification of the minecraft.jar file. Versions from 13w16a have a directory in which you can pop in language packs and have them show in the Languages menu.
Now let's get started.
First, create a new folder somewhere, presumably called lang. If this is the first time using the 1.6 snapshots, then after launching the game, the English pack will be in .minecraft/assets/lang. Move assets/lang/en_US.lang to your lang folder, then copy that into the same folder and rename it something that makes sense, followed by the three letters "dev."
If you are playing a different version than the first snapshot that you played from your new launcher, you need to go to versions/(current version)/minecraft.jar, open the archive, and retrieve lang/en_US.lang. (In Windows, changing the extension to .zip while having file extensions shown should work; I think Linux has an archive tool that works with .jars.) Copy it to your personal language folder.
It is advisable to base off your development pack off of en_US.lang. (We'll learn how to remove the translations identical to those of en_US.lang. Which brings us to the next point:
Note 2: Don't use Notepad.
The built-in language packs use Unix-style returns (i. e. they use "\n" instead of "\n\r" for Windows), and Notepad won't be able to display them. I personally use jEdit. If you're starting from scratch (which I wouldn't suggest), Notepad is fine.
Once you have the editing window on the newly copied file, you should see that the names the code uses internally appears to the left of the equals sign. Don't change them. Change the strings to the right instead. If you want to insert comments, use a pound sign ("#") at the beginning of the line.
A percent sign means a formatting field: %s means a string, %d means an integer, and %.2f means a floating-point number. If there are multiple fields of the same type, then they may be distinguished by having a number (starting with 1) and a dollar sign so the order of the fields can be reversed (e. g. "%1$s was slain by %2$s"). Note: save with UTF-8 encoding.
Once you've changed some fields, you will want to remove the default translations, or you'd be breaching Mojang's ToS. I wrote a little program in C to do that.
It is also useful to have a batch file (or shell script) to automate the publishing process. Assuming that your development pack is ncs_AAdev.lang and you want the finished pack to be called ncs_AA.lang, your batch file will be like this:
If you're using Linux, the shell script will be different, but similar in what it does. (It runs the program above, then copies it to the appropriate directory.)
Now some tips on translation itself.
Most of the tips for the above section applies, but:
Thank you for reading this guide!