docs: revise FAQ content and update all translations

This commit is contained in:
NetworkCats
2026-03-05 02:24:53 +08:00
parent 4a461cbd92
commit d0746f159b
17 changed files with 737 additions and 739 deletions
+25 -25
View File
@@ -236,47 +236,47 @@ fn build_translations(locale: Locale) -> Translations {
t_faq_cli_q: i18n::translate(locale, "How to use this service from the command line"),
t_faq_cli_a: i18n::translate(
locale,
"You can use various command-line tools such as curl, httpie, and wget to use this service. Taking the most popular one, curl, as an example:",
"You can use curl, httpie, wget, or whatever command line tool you prefer. Here's an example with curl:",
),
t_faq_cli_query_current: i18n::translate(locale, "Query current IP:"),
t_faq_cli_query_own: i18n::translate(locale, "Query information for your own IP:"),
t_faq_cli_json: i18n::translate(locale, "Or display all information in JSON format:"),
t_faq_cli_specific: i18n::translate(locale, "Query information for a specific IP:"),
t_faq_cli_query_current: i18n::translate(locale, "Check your current IP:"),
t_faq_cli_query_own: i18n::translate(locale, "Look up information about your own IP:"),
t_faq_cli_json: i18n::translate(locale, "Or get everything in JSON format:"),
t_faq_cli_specific: i18n::translate(locale, "Look up information about a specific IP:"),
t_faq_ipv46_q: i18n::translate(
locale,
"How to force the display of my IPv4 or IPv6 address?",
"How do I force IPv4 or IPv6?",
),
t_faq_ipv46_a: i18n::translate(
locale,
"You can use <code>curl -4</code> or <code>curl -6</code> to view only your IPv4 or IPv6 address respectively.",
"Use <code>curl -4</code> or <code>curl -6</code> to specifically check your IPv4 or IPv6 address.",
),
t_faq_json_q: i18n::translate(locale, "How to get a JSON format response?"),
t_faq_json_q: i18n::translate(locale, "How do I get a JSON response?"),
t_faq_json_a: i18n::translate(
locale,
"You can send a request to the <code>/json</code> endpoint, or send a request with an <code>application/json</code> header.",
"Send a request to the <code>/json</code> endpoint, or send a request with the <code>application/json</code> header.",
),
t_faq_automate_q: i18n::translate(
locale,
"Can I automate calls to your service via programs?",
"Can I call your service programmatically?",
),
t_faq_automate_a1: i18n::translate(
locale,
"Certainly, as long as the rate limit is respected. Under normal conditions, the rate limit is 30 RPM (Requests Per Minute); under high load, we will increase the restriction to 10-5 RPM.",
"Sure, but please respect our rate limits. Normally it's 30 RPM, and under heavy load we may drop it to 10 or 5 RPM.",
),
t_faq_automate_a2: i18n::translate(
locale,
"Our API is only suitable for manual calls or small-scale projects. If your website uses our API to query visitor IPs, please ensure you use a message queue to send requests to avoid blocking. If your project has high traffic or is latency-sensitive, please use our open-source offline database: <a href=\"https://github.com/NetworkCats/Merged-IP-Data\">Merged IP Database</a>, which is the same database used by this project.",
"The API is meant for manual use or small projects. If your site uses our API to look up visitor IPs, please use a message queue so requests don't block. If your project has high traffic or needs low latency, you're better off using our open source offline database: <a href=\"https://github.com/NetworkCats/Merged-IP-Data\">Merged IP Database</a>. That's actually what this project uses under the hood.",
),
t_faq_data_q: i18n::translate(locale, "Where does the IP data come from?"),
t_faq_data_a: i18n::translate(
locale,
"IP geographic data primarily comes from the free databases of MaxMind and DB-IP; AS data comes from IPinfo's free database; and IP proxy data comes from my own <a href=\"https://github.com/NetworkCats/OpenProxyDB\">OpenProxyDB</a> database.",
"Geolocation data mainly comes from the free databases by Maxmind and DB-IP. AS data comes from IPinfo's free database. Proxy data comes from my own <a href=\"https://github.com/NetworkCats/OpenProxyDB\">OpenProxyDB</a>.",
),
t_faq_data_attr: i18n::translate(locale, "Data Attributions:"),
t_faq_selfhost_q: i18n::translate(locale, "Can I run my own service?"),
t_faq_data_attr: i18n::translate(locale, "Data attributions:"),
t_faq_selfhost_q: i18n::translate(locale, "Can I run my own instance?"),
t_faq_selfhost_a: i18n::translate(
locale,
"Yes, the source code and database for this project are both open-source and hosted on GitHub:",
"Yes, the source code and database are both open source and on GitHub:",
),
t_faq_diff_q: i18n::translate(
locale,
@@ -284,33 +284,33 @@ fn build_translations(locale: Locale) -> Translations {
),
t_faq_diff_a1: i18n::translate(
locale,
"The biggest difference is that our database includes proxy-related information, and the proxy intelligence we provide is highly accurate. We have privately compared it with commercial proxy detection databases like IPinfo; our database's precision is fully comparable to commercial ones, and it is even more accurate in detecting residential proxies.",
"The biggest thing is proxy detection. Our database covers proxy related data and the accuracy is really good. We've tested it privately against commercial databases like IPinfo's, and we hold up just as well, and actually do better on residential proxy detection.",
),
t_faq_diff_a2: i18n::translate(
locale,
"Secondly, our geographic coverage for IPv6 is more comprehensive because we merge multiple databases to provide more complete data.",
"We also have better IPv6 geolocation coverage since we merge multiple databases together, so the data ends up being more complete.",
),
t_faq_diff_a3: i18n::translate(
locale,
"Our UX is also better than any IP lookup site on the market. The site runs without any JavaScript, and we only load a minimal amount of external resources (fonts, icons), making the initial load speed extremely fast.",
"The UX is also better than most IP lookup sites out there. The site runs without any JavaScript, and we only pull in a minimal amount of external resources (fonts and icons), so it loads fast on the first visit.",
),
t_faq_stable_q: i18n::translate(locale, "Is this service stable?"),
t_faq_stable_q: i18n::translate(locale, "Is this service reliable?"),
t_faq_stable_a1: i18n::translate(
locale,
"The business logic of this service is written entirely in Rust, offering excellent performance that ensures the site remains operational even under L7 DDoS attacks. The site runs on a VPS with 2 cores and 2 GB of RAM, which is already overkill for this setup -- unless we encounter a massive L7 DDoS attack, though we have Cloudflare in front of us.",
"The whole thing is written in Rust, so performance is great. It can handle L7 DDoS traffic and stay up fine. It runs on a 2 core 2 GB VPS, which is already more than enough. The only thing that could cause real trouble is a large scale L7 DDoS, but we have Cloudflare in front of us.",
),
t_faq_stable_a2: i18n::translate(
locale,
"Running this website only costs me $18.00 per month. Because the cost is so low, I will not stop operations due to hardware costs in the foreseeable future, nor will I add any advertisements.",
"It costs me $18.00/month to run, which is pretty cheap. I'm not going to shut it down over hosting costs anytime soon, and there won't be any ads.",
),
t_faq_stable_a3: i18n::translate(
locale,
"Rest assured, this service will definitely not \"Rug Pull.\"",
"This service is not going to rug pull on you.",
),
t_faq_sponsor_q: i18n::translate(locale, "How can I sponsor this service?"),
t_faq_sponsor_q: i18n::translate(locale, "How can I support this service?"),
t_faq_sponsor_a: i18n::translate(
locale,
"I accept cryptocurrency donations. If you would like to sponsor, please contact:",
"I accept crypto donations. If you want to contribute, reach out at:",
),
t_footer_license: i18n::translate(locale, "Website source code licensed under"),
t_footer_source: i18n::translate(locale, "Website Source"),
+6 -8
View File
@@ -459,22 +459,20 @@ mod tests {
}
#[test]
fn translate_strings_with_escaped_quotes() {
// These strings contain \" in PO files. The parser must correctly unescape
// them and produce valid translations for all locales.
let msgid_rug_pull = "Rest assured, this service will definitely not \"Rug Pull.\"";
fn translate_rug_pull_string() {
let msgid_rug_pull = "This service is not going to rug pull on you.";
for locale in Locale::ALL {
let result = translate(*locale, msgid_rug_pull);
assert!(
!result.is_empty(),
"locale {:?} has no translation for Rug Pull string",
"locale {:?} has no translation for rug pull string",
locale
);
if *locale != Locale::En {
assert_ne!(
result, msgid_rug_pull,
"locale {:?} should have a non-English translation for Rug Pull string",
"locale {:?} should have a non-English translation for rug pull string",
locale
);
}
@@ -484,8 +482,8 @@ mod tests {
#[test]
fn translate_strings_with_html_href() {
// Strings containing <a href=\"...\"> have escaped quotes in PO files.
let msgid_api = "Our API is only suitable for manual calls or small-scale projects. If your website uses our API to query visitor IPs, please ensure you use a message queue to send requests to avoid blocking. If your project has high traffic or is latency-sensitive, please use our open-source offline database: <a href=\"https://github.com/NetworkCats/Merged-IP-Data\">Merged IP Database</a>, which is the same database used by this project.";
let msgid_data = "IP geographic data primarily comes from the free databases of MaxMind and DB-IP; AS data comes from IPinfo's free database; and IP proxy data comes from my own <a href=\"https://github.com/NetworkCats/OpenProxyDB\">OpenProxyDB</a> database.";
let msgid_api = "The API is meant for manual use or small projects. If your site uses our API to look up visitor IPs, please use a message queue so requests don't block. If your project has high traffic or needs low latency, you're better off using our open source offline database: <a href=\"https://github.com/NetworkCats/Merged-IP-Data\">Merged IP Database</a>. That's actually what this project uses under the hood.";
let msgid_data = "Geolocation data mainly comes from the free databases by Maxmind and DB-IP. AS data comes from IPinfo's free database. Proxy data comes from my own <a href=\"https://github.com/NetworkCats/OpenProxyDB\">OpenProxyDB</a>.";
for locale in Locale::ALL {
let api_result = translate(*locale, msgid_api);