Return the string representation of the locale compatible with the
        HTTP header ``Accept-Language`` as specified in `RFC 7231
        <https://tools.ietf.org/html/rfc7231#section-5.3.5>_`

        The Accept-Language request HTTP header advertises which languages the
        client is able to understand, and which locale variant is preferred.


        @return: a string representation of this locale compatible with HTTP
            request, i.e., a ISO 639-3 alpha-2, optionally followed by a dash
            character ``-`` and a ISO 3166-1 alpha-2 code.

def to_http_string(self):
        """
        Return the string representation of the locale compatible with the
        HTTP header ``Accept-Language`` as specified in `RFC 7231
        <https://tools.ietf.org/html/rfc7231#section-5.3.5>_`

        The Accept-Language request HTTP header advertises which languages the
        client is able to understand, and which locale variant is preferred.


        @return: a string representation of this locale compatible with HTTP
            request, i.e., a ISO 639-3 alpha-2, optionally followed by a dash
            character ``-`` and a ISO 3166-1 alpha-2 code.
        """
        return self.language_code[:2] if self.country_code is None \
                else '%s-%s' % (self.language_code[:2], self.country_code)