Updated and restructured library documentation to include Locale changes

Updated Getting Started Docs

Added documentation for Result Handling

removed api documentation
This commit is contained in:
anqixxx
2025-08-20 09:54:25 -04:00
parent 196de9e974
commit 4cdd2526b6
2 changed files with 14 additions and 6 deletions

View File

@@ -268,13 +268,17 @@ name out of it:
'Brugges' 'Brugges'
``` ```
The `address_row` field has a helper function to apply the function to all The `address_row` field has a helper function to compute the display name for each Address Line
its members and save the result in the `local_name` field. It also returns component based on its `local_name` field. This is then utilized by the overall `result` object,
all the localized names as a convenient simple list. This list can be used which has a helper function to apply the function to all its address_row members and saves
to create a human-readable output: 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 ``` python
>>> address_parts = results[0].address_rows.localize(locale) >>> Locales().localize_results(results)
>>> address_parts = results[0].address_rows
>>> print(', '.join(address_parts)) >>> print(', '.join(address_parts))
Bruges, Flandre-Occidentale, Flandre, Belgique Bruges, Flandre-Occidentale, Flandre, Belgique
``` ```

View File

@@ -49,7 +49,11 @@ its address.
## Localization ## 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 ### Locale