Question: How faker parse and find data/list for format like {{ last_name }} - {{ first-name }} ?
Hello new to faker codebase, i have question how faker parse the format tokenName and how its gets the reference for the data of that token name, I want to make company name with locale Indonesia (id_ID) with Indonesian name company or Indonesian last_name,
But I am new to programming and not understand how the codebase work,
do i need to make last_names data/list in id_ID locale for faker.person __init__.py and faker will automatically chose the last_name with Indonesia locale or i need do something else?
Thank you
when i search last_name data/list/tuple/dict i just find last_names (with "s" plural), I cannot find last_name data
Where did you read about the placeholders? What is your current code?
https://github.com/joke2k/faker/blob/faa419b7af433c75253374c3d319ba5ffc3139cd/faker/providers/company/id_ID/init.py#L3C1-L11
How to track down {{ last_name }}? And how to use last_name that uses id_ID locale data?
class Provider(CompanyProvider):
formats = (
"{{company_prefix}} {{last_name}}",
"{{company_prefix}} {{last_name}} {{last_name}}",
"{{company_prefix}} {{last_name}} {{company_suffix}}",
"{{company_prefix}} {{last_name}} {{last_name}} {{company_suffix}}",
)
Thankyou
The logic is handled in https://github.com/joke2k/faker/blob/faa419b7af433c75253374c3d319ba5ffc3139cd/faker/generator.py#L161 The corresponding values are retrieved from the corresponding providers - the company_suffix from the company provider, the last_name from the person provider. The last name should already use the localized values as far as I understand the code.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.