junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.59k stars 134 forks source link

[Fix / Enhancement] Improve `accept-language` header handling #130

Closed SethuSenthil closed 1 year ago

SethuSenthil commented 1 year ago

This pull request aims to enhance the handling of the accept-language header in the codebase. The current implementation hardcodes the language to ko (Korean), which can potentially cause issues in the future and make the library more detectable. To address this, I have made the following changes:

  1. Utilized the cross-platform Intl namespace learn more here, which is built into the Node.js, Deno, and Browser runtimes, to retrieve the preferred language setting from the device or server where the code is running.
  2. Exposed the language setting as a configurable option, allowing users to manually set the desired language if needed.

These changes improve the flexibility and future-proofing of the library by dynamically determining the language based on the device's (runtime's) preferred settings.

SethuSenthil commented 1 year ago

awesome i dont like korea that much anyway 👍👍

😂😂😂