reload_config_texts(3alleg4)

✨ reload_config_texts ✨

okay bestie, welcome to the Allegro manual (yes, that Allegro, the game programming library, she's iconic πŸ’…). this page is all about reload_config_texts, and no cap, she's the glow-up button for your translated strings. let's get into it 🫢


🌸 NAME 🌸

reload_config_texts β€” reloads the translated strings that get_config_text() hands back to you. it's giving Allegro game programming library energy, fr fr. ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void reload_config_texts(const char *new_language);

like, that's the whole vibe. one include, one function, no drama. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜•: this function reloads the translated strings returned by get_config_text(). and why do we care? because it lets you switch to another language in your program, at runtime. main character move, honestly. 😌

now, the way you drive it depends on the situation:

  • if you want to modify the [system] language configuration variable yourself, or you've switched configuration files, then you're gonna want to pass NULL β€” that just reloads whatever language is currently selected. lowkey the chill option. 🧘
  • or you can pass a string containing the two letter code of the language you desire to switch to, and the function will modify the language variable for you. okay multitasking queen. πŸ‘‘
⚠️ bestie listen to me: after you call this function, the previously returned pointers of get_config_text() will be invalid. like, dead. expired. do NOT touch them. it's giving undefined behaviour and we do not want that πŸ’€

here's the example, straight from the source, no edits:

...
/* The user selects French from a language choice menu. */
reload_config_texts("FR");

see how she just pops "FR" in there? ate that. πŸ”₯


🌈 SEE ALSO 🌈


and that's the page, bestie! this was brought to you by Allegro, version 4.4.3 β€” reload_config_texts(3alleg4), periodt. go forth and switch languages like the icon you are πŸŽ€πŸ’–πŸŒΈπŸ¦‹πŸ‘‘