i18n_clear_cache()
The i18n_clear_cache()
function is used to clear the cache in the GM-I18n system.
This function can only be used after the i18n_create()
function is called.
Syntax
Usage
i18n_clear_cache([i18n]);
Parameters
Name | Type | Default | Description |
---|---|---|---|
i18n | Boolean | I18n | false | The I18n struct reference, or leave it empty to use the global i18n struct. |
Returns
Void
Examples
Create Event
// assume the system is initialized on global variable
// create some caches
i18n_create_cache("hello", , "en"); // "Hello World!"
i18n_create_cache("bye", , "en"); // "Goodbye World!"
i18n_create_cache("greet", { // "Halo, John!"
name: "John"
}, "id");
It's recommended to only clear the cache when you're sure that you won't need the cached message anymore. So, the suitable events to clear the cache are
The cache is automatically cleared when the i18n system is destroyed, so you don't have to worry about memory leaks.
The message caching isn't available for HTML5 export. So, this function will do nothing in HTML5.
Clean Up Event
, Room End Event
, Game End Event
, or other events that you know that the caches won't be used again. The cache is automatically cleared when the i18n system is destroyed, so you don't have to worry about memory leaks.
The message caching isn't available for HTML5 export. So, this function will do nothing in HTML5.
Don't use this function on events that updated every step (such as
Step Event
, Draw Event
, etc.)! It will cause a performance issue and there's no point to use the message caching feature if you do that.Table of Contents