Jump to content

[Question] locale_string.txt


Recommended Posts

7 hours ago, Mind Rapist said:

# python build_locale_string.py in your terminal, but this will only add the korean strings, you'll have to start translating each string seperately.

Yes that I want! :D Great!

@SussyFlore

I know, but I must check all files.. Not good for my free time.. Better for me is generate LC_TEXT from source just all in locale_string and translate it.. Its so ugly if I have one language, but fastest.. Maybe only translate in english, because universal language, but for my language I  dont want it.. :D

Link to comment
Share on other sites

1 hour ago, Cunoo said:

Yes that I want! :D Great!

@SussyFlore

I know, but I must check all files.. Not good for my free time.. Better for me is generate LC_TEXT from source just all in locale_string and translate it.. Its so ugly if I have one language, but fastest.. Maybe only translate in english, because universal language, but for my language I  dont want it.. :D

I translated a source from korean to romanian in 2 days.

It's not need very much time

  • Love 2
Link to comment
Share on other sites

  • 2 months later...
  • Forum Moderator

If somebody needs, there's a old shit which i did for somebody who had the source with no LC_TEXT and re-convert the source and adding LC_TEXT("string_index") and write a new locale_string.txt with string_index = the string which you had before.

Ignore the code, is a shit, take just the idea.

# Output:
"""
"LOCALE_STRING_01";
"Hai ricevuto %d";

"LOCALE_STRING_02";
"Una luce proviene da un grande albero";

"LOCALE_STRING_03";
"Hai ricevuto %d ";

"LOCALE_STRING_04";
"Target is in %d channel (my channel %d)";

"LOCALE_STRING_05";
"Cannot find map (index %d)";

"LOCALE_STRING_06";
"You warp to ( %d, %d )";

"LOCALE_STRING_07";
"There is no one by that name";

"LOCALE_STRING_08";
"You warp to ( %d, %d )";

"LOCALE_STRING_09";
"<Mercatino Offline> Rinnovato di 30 giorni. Verrai sconnesso tra 3 secondi.";
"""

def UpdateLocaleString_SRC():
	basePath, baseExcludeExt = (SRC_GAME_BASE_PATH, EXTENSION_EXCLUDED_LIST_SRC)

	localeStringList = []
	for root, dirs, files in os.walk(basePath, topdown = True):
		dirs[:] = [dir for dir in dirs if dir not in DIRECTORY_EXCLUDED_LIST]

		countFunc = 0
		for fileName in [file for file in files if GetExtension(file) not in baseExcludeExt]:
			# Cpp file
			fileName = '{:s}/{:s}'.format(root, fileName)

			for line in open(fileName, 'r').readlines():
				line = line.strip('\n')
				
				chatLocaleString = '"LOCALE_STRING_%02u")'
				
				if LC_TEXT in line:
					continue
				
				if chatPacketFunc not in line:
					continue

				chatPointer = line.split(chatPacketFunc)[0].strip()
				chatType = line.split(chatPacketFunc)[1].split(",")[0]
				chatLine = chatMacroLocale % chatPointer
				chatIndexFindBeginString = line.find('"')
				chatIndexFindEndString = line.rfind('"') + 1
				chatLastArgs = line[chatIndexFindEndString : len(line)]
				chatLocaleStringFinal = chatLocaleString % countFunc
				chatPosition = line.split(chatPacketFunc)[0]
				if chatPointer:
					chatPosition = line.split(chatPointer)[0]
				
				chatResult = chatPosition + chatPointer + chatPacketFunc + chatType + ", " + chatLine + chatLocaleStringFinal + chatLastArgs
				
				bAdded = AddLocaleString(fileName, line, chatResult)
				if bAdded:
					localeStringList.append((chatLocaleStringFinal[:-1] + ';', line[chatIndexFindBeginString : chatIndexFindEndString] + ';'))
					countFunc += 1
			
	f = open("{:s}/{:s}".format(basePath, LOCALE_STRING_FILE_NAME), 'a+')
	for first, second in localeStringList:
		f.write('{:s}\n{:s}\n\n'.format(first, second))
	f.close()

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.