Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum for languages #37

Merged
merged 6 commits into from
Jul 1, 2023
Merged

Enum for languages #37

merged 6 commits into from
Jul 1, 2023

Conversation

pnewstein
Copy link
Contributor

@pnewstein pnewstein commented Jun 29, 2023

Currently, setting the language for posts and comments is difficult, because you need to know the integer that corresponds to the language ID.

This pull request adds an Enum for the language IDs. So now you can do:

from pythorhead.types import LanguageType
# Get lemmy object, login
lemmy.post.create(community_id, "title", language_id=LanguageType.EN)

Using an int is still supported

lemmy.post.create(community_id, "title", language_id=37)

@pnewstein pnewstein mentioned this pull request Jul 1, 2023
@NicKoehler NicKoehler merged commit ecba5e1 into db0:main Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants