Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6849181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:57:30+00:00 2026-05-27T00:57:30+00:00

I am writing a method to my class and I like internationalize my projects.

  • 0

I am writing a method to my class and I like internationalize my projects. Now I’m developing a really multilingual system. I want to translate documentation.
About how to translate new line after the definition of the method is nothing in the django documentation.
I’m try write:

from django.utils.translation import ugettext_lazy as _
class Items(Model):
    ...
    ...
    def total(self):
        _(""" Method: Count total order price""")
        return self.__total

but in the admin-doc has no effect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:57:31+00:00Added an answer on May 27, 2026 at 12:57 am

    If you specifiy __doc__ attribute as first statement, it should be literal and not expression.

    I think this could work:

    from django.utils.translation import ugettext_lazy as _
    class Items(Model):
        __doc__ = _('translatable description for Items')
    
        def total(self):
            return self.__total
        total.__doc__ = _(""" Method: Count total order price""")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Ruby class, and want to override the == method. I want
I wonder if there is a way of writing a method or a class
I'm writing a method to wrap another method as part of a class. It
I've got a method in a class that's writing to some string, which calls
What would be a better parctice, writing the drawing method inside the GameObject class
I'm writing a JavaSCript class that has a method that recursively calls itself. Scheduler.prototype.updateTimer
I have a method I'm writing that uses reflection to list a class's static
I'm writing a test for a file parser class. The parse method receives a
I have a doubt about orkut's new URL Writing method. Earlier the home page
I want to write a 'Date' class that behaves like a Value Type. for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.