From 4cdd2526b6fcd974cc643fdf3a7cb9e8b451bba6 Mon Sep 17 00:00:00 2001 From: anqixxx Date: Wed, 20 Aug 2025 09:54:25 -0400 Subject: [PATCH] Updated and restructured library documentation to include Locale changes Updated Getting Started Docs Added documentation for Result Handling removed api documentation --- docs/library/Getting-Started.md | 14 +++++++++----- docs/library/Result-Handling.md | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/library/Getting-Started.md b/docs/library/Getting-Started.md index 9f81724a..36876206 100644 --- a/docs/library/Getting-Started.md +++ b/docs/library/Getting-Started.md @@ -268,13 +268,17 @@ name out of it: 'Brugges' ``` -The `address_row` field has a helper function to apply the function to all -its members and save the result in the `local_name` field. It also returns -all the localized names as a convenient simple list. This list can be used -to create a human-readable output: +The `address_row` field has a helper function to compute the display name for each Address Line +component based on its `local_name` field. This is then utilized by the overall `result` object, +which has a helper function to apply the function to all its ‘address_row’ members and saves +the result in the `locale_name` field. + +However, in order to set this `local_name` field in a preferred language, you must use the `Locale` +object which contains the function `localize_results`, which explicitly sets each `local_name field`. ``` python ->>> address_parts = results[0].address_rows.localize(locale) +>>> Locales().localize_results(results) +>>> address_parts = results[0].address_rows >>> print(', '.join(address_parts)) Bruges, Flandre-Occidentale, Flandre, Belgique ``` diff --git a/docs/library/Result-Handling.md b/docs/library/Result-Handling.md index 1e8043cf..81d445c4 100644 --- a/docs/library/Result-Handling.md +++ b/docs/library/Result-Handling.md @@ -49,7 +49,11 @@ its address. ## Localization -Results are always returned with the full list of available names. +Results are always returned with the full list of available names. However, the +default `locale_name` must be explicitly set using the `localize` function within +`Locales`. This parses through the full list of available names to find the one +most preferred by the user. Once this is set, the user can simply use the +`display_name` field within a `Result` object to retrive the localized name. ### Locale -- 2.39.5