First off, to be honest this include is similar to y_language from a certain point of view, however SQLite makes it way more developer-friendly and adds many functions that allow developers to add, modify, delete or manipulate in any possible way the strings in-game! Developers will be able to make systems to allow users giving a contribute to the server making user-made translations for their own language, for example. |
/*
* SQLiteLang_Initialize
* This function declares the name of the database and saves it into a variable (both file and directory).
* If the database does not exist, a new one will be created by default in the folder 'SQLiteLang'.
*
* optional: file[] ("SQLiteLang/Database/Database.db") = Directory and file name of the database.
* optional: bool:init_debug (false) = Turning this on will activate the debugging mode.
*/
/*
* SQLiteLang_Terminate
* This function terminates the usage of the include and resets the saved name and directory of the database internally to default.
*/
/*
* SQLiteLang_AddIdentifier
* This function adds a new string identifier to the database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* description[] = The description of the identifier (ie. "string that welcomes new players in the server").
*/
/*
* SQLiteLang_DeleteIdentifier
* This function deletes all the language strings of a specific identifier from the database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
*/
/*
* SQLiteLang_ModifyIdentifier
* This function modifies an identifier name to new one.
*
* old_identifier[] = The identifier to be modified.
* new_identifier[] = The new name of the identifier.
*/
/*
* SQLiteLang_ModifyIdentifierDesc
* This function modifies an identifier's description to a new one.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* new_desc[] = The new description of the identifier.
*/
/*
* SQLiteLang_AddLanguage
* This function adds a new language to the database.
*
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
* description[] = The description of the language (ie. "English" or "Italian Language" or "{FFFFFF}Spanish").
*/
/*
* SQLiteLang_DeleteLanguage
* This function deletes a specific language from database.
* Be careful, deleting a language will delete all the language strings already added in the database.
* Furthermore, you may not delete the default language, if set.
*
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_ModifyLanguage
* This function modifies a language name to new one.
*
* old_lang[] = The language to be modified.
* new_lang[] = The new name of the language.
*/
/*
* SQLiteLang_ModifyLanguageDesc
* This function modifies a language's description to a new one.
*
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
* new_desc[] = The new description of the language.
*/
/*
* SQLiteLang_AddString
* This function adds a new string to the database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
* string[] = The string is the actual string of text to show in different languages.
*/
/*
* SQLiteLang_DeleteString
* This function deletes a specific language string of a specific identifier from the database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_ModifyString
* This function modify a specific language string in database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
* new_string[] = The string is the new actual string of text to show in different languages that will replace the old one.
*/
/*
* SQLiteLang_ShowLanguageString
* This function shows a specific language string taken from the database.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* optional: lang[] (default language) = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_ShowPlayerString
* This function shows a specific language string taken from the database.
*
* playerid = playerid of the player.
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
*/
/*
* SQLiteLang_SetDefaultLang
* This function sets the default language for users that haven't selected an available language.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_SetPlayerLang
* This function sets the language of a player.
*
* playerid = playerid of the player.
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_IsIdentifierValid
* This function checks if an identifier exists.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
*/
/*
* SQLiteLang_IsLanguageValid
* This function checks if a language exists.
*
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
/*
* SQLiteLang_IsStringValid
* This function checks if a string already exists.
*
* identifier[] = The identifier is used to identify, as the parameter says, every string of text (ie. "welcome_string").
* lang[] = The lang is used to identify the language of the string (ie. "en" or "IT" or "spanish").
*/
#include <sqlitelang>
// This will use the default directory which is 'SQLiteLang/Database/Database.db'.
// Make sure the folder 'SQLiteLang' exists or the automatic process will not work.
SQLiteLang_Initialize(.init_debug = true);