SET_LOCALE(4)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ¦‹ Set_Locale(special file) β€” bestie, it's a manual page πŸ¦‹

okay so we're folding the manual name in right here: Set_Locale(special file). That's the header vibe, and now we can get into the actual lore. πŸ’…

✨ NAME ✨

Set_Locale β€” set a tool's locale.

🌸 SYNOPSIS 🌸

       Set_Locale(in string category,
               in string locale
               [...]);

πŸŽ€ DESCRIPTION πŸŽ€

okay so the Set_Locale request reports the POSIX locale of the locale categories you indicate. That's the whole main character move. πŸ’–

The category argument is the locale category to set. A locale category is a group of data types whose output formatting varies according to locale in a similar way. It's giving formatting squad, honestly. The ISO C and X/Open locale categories are:

  • LC_ALL
  • LC_COLLATE
  • LC_CTYPE
  • LC_MESSAGES
  • LC_MONETARY
  • LC_NUMERIC
  • LC_TIME

The locale argument is the name of the locale to set the indicated category to. The value of locale is implementation-defined. Not me reminding you that the actual value is on the implementation, but yes β€” implementation-defined, periodt. iykyk. ✨

πŸ’€ ERRORS πŸ’€

The ToolTalk service may return the following error in processing the Set_Locale request:

  • TT_DESKTOP_EINVAL β€” the locale argument is not valid on the handler's host.

lowkey that's the whole error tea: invalid locale on the handler's host. No cap. 🫢

🫢 APPLICATION USAGE 🫢

The ttdt_session_join(3) function can be used to register for, and transparently process, the Set_Locale request. That is highkey the plug if you want the request handled for you. I'm obsessed with a transparent-process setup, honestly. ✨

πŸ”₯ EXAMPLES πŸ”₯

The Set_Locale request can be sent as in the following example:

       Tt_message msg = tttk_message_create(0, TT_REQUEST, TT_SESSION,
                               the_recipient_procid, TTDT_SET_LOCALE,
                               my_callback);
       tt_message_arg_add(msg, TT_IN, Tttk_string, "LC_MONETARY");
       tt_message_arg_add(msg, TT_IN, Tttk_string, "de");
       tt_message_send(msg);

🚨 WARNINGS 🚨

bestie, real talk: Set_Locale can also be sent as a multicast notice, as an edict to all tools in the scope of the message. The consequences of doing so can be severe and unexpected. That is not a cute little vibe check; that's the actual warning. fr fr. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

okay that's the page, bestie. Footer/source/version/date tea: the footer just repeats Set_Locale(special file) β€” no extra date or source/version line on this one, so that's the cute sign-off. πŸŽ€βœ¨

πŸ“¦ where this page comes from