Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ANY?] Localization Server


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 476
  • Lokalizacja:AMXX.PL
Offline

Napisano 19.01.2016 07:15

<div><b>Description:</b><br />A small library to query for localized strings in a database by string token (such as the keys from <tt>/tf/resource/tf_english.txt</tt>).<br /><br />Localizations are read from the game's <tt>/resource</tt> directory through a Python script and stored in an SQLite database. Kind of similar to TF2 Item DB. You'll want to run the script every now and then to keep the translations fresh.<br /><br />Originally, I wasn't going to finish working on this (I've had the Python script for what feels like <i>forever</i>), but I've been working on a plugin that reads certain usermessages that would need colorization as of late. <a href="https://forums.allie...d.php?t=277694"target="_blank">And someone mentioned Sourcemod being unable to access these translations.</a><br /><br /><b>Installation:<br /></b><ol style="list-style-type: decimal"><li>Install <tt>localization_server.smx</tt> as you would any other plugin.</li>
<li>Add localization strings.<ol style="list-style-type: decimal"><li>If using TF2 (and only TF2):<ol style="list-style-type: decimal"><li><a href="http://gamedownloads...nom.us/langdb/"target="_blank">Download and unpack the language-db.7z file available here</a> to <tt>addons/sourcemod/data/sqlite</tt><br />(Note: That database may or may not get updates.)</li>
</ol></li>
<li>If trying to use strings other than those under <tt>/tf/resources</tt> (manual generation):<ol style="list-style-type: decimal"><li><a href="https://pypi.python.org/pypi/vdf/"target="_blank">Install the <tt>vdf</tt> library.</a></li>
<li>Modify the Python script (<tt>utilities/localization_db.py</tt>) as needed to point to your game directory, language files, and Sourcemod installation, then run. Currently requires Python2 (the script was just modified from TF2IDB). I assume the language files are structured in the same way as TF2's; I can't test them myself.</li>
</ol> </li>
</ol> </li>
</ol><b>Things this plugin might clobber:<br /></b>I've only ever tested English strings so far, if that tells you anything.<br /><b><br />Usage:</b><br />The plugin currently provides two natives and one callback. Should be self-explanatory:<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">// note: do not include the &quot;#&quot; symbol in the token<br /><br />// threaded (eventually??)<br />native void LanguageServer_GetLocalizedString(int language, const char[] token, LocalizedStringCallback callback, any data = 0);<br />typedef LocalizedStringCallback = function void(int language, const char[] token, const char[] result, any data);<br /><br />// non-threaded<br />native bool LanguageServer_ResolveLocalizedString(int language, const char[] token, char[] buffer, int maxlen);</code><hr />
</div>Sample usage is available as the <a href="https://github.com/n...zation_test.sp"target="_blank">localization_test</a> plugin.<br /><br /><br /><a href="https://github.com/nosoop/SM-LocalizationServer" target="_blank">Source code and include files on Github.</a></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie.../attach/sp.gif"alt="File Type: sp" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="http://www.sourcemod...68"><strong>GetPlugin</strong></a> or
<a href="https://forums.allie...1453182558">GetSource</a> (localization_server.sp - 3.5 KB)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych